Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

JSON fields not rendered by the builder 16 Mar 2017 18:37 #15043

  • vlemos
  • vlemos's Avatar Topic Author
  • Online
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
JSON fields no longer rendered by the builder :ohmy:

Please Log in or Create an account to join the conversation.

JSON fields not rendered by the builder 11 May 2017 16:25 #15126

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
This is normal,
JSON has never been rendered, it is simply a helper at the moment.

In future, JSON field will propose :
- a sub form in the FORM
- a sub layout in the FLY
- a sub layout in the GRID

At the moment, when you instance a JSON field it simply place this code in populateObjects()
if (!empty($item->my_object_json) && is_string($item->my_object_json))
{
	$registry = new JRegistry;
	$registry->loadString($item->my_object_json);
	$item->my_object_json = $registry->toObject();
}

And in save() :
if (isset($data['my_object_json']) && is_array($data['my_object_json']))
{
	$registry = new JRegistry;
	$registry->loadArray($data['my_object_json']);
	$data['my_object_json'] = (string) $registry;
}

Simply a coder/decoder. Nothing else.
I should explain it better in the docs.

Note : The docs are under construction, I am currently creating that,
I will release it during 2017. It is gonna be beautiful, but it is a long way.
Coding is now a piece of cake
The following user(s) said Thank You: vlemos

Please Log in or Create an account to join the conversation.

Last edit: by admin.
  • Page:
  • 1
Time to create page: 0.077 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started