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

TOPIC:

Params column in every table? 12 Dec 2012 23:20 #6035

i don't know if it's the Cook learning curve or the Joomla 2.5 learning curve, but i'm quite confused about why every record has a params column. I've tinkered with Cook to try and modify it's contents, but with no success.

How does one implement the record level params in the component?

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

Re: Params column in every table? 13 Dec 2012 11:05 #6043

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
It is always empty for the moment.

Very old feature still not developped.
I should remove it but for the moment always present everywhere.

In J2.0 its name should even be 'attribs'...
I will develop it soon.

The puropose is simply for storing JSON objects. The contents will always be JSON.
Coding is now a piece of cake
The following user(s) said Thank You: gdpodesta

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

Re: Params column in every table? 13 Dec 2012 16:30 #6067

So assuming I don't update my component from the Cook Builder, I'm safe to use it for my own reasons? If so, are there any core Joomla functions that can easily be used to get/set them? Even if it's not "MVC", since it's there, I'm just curious about ways that I might take advantage of it.

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

Re: Params column in every table? 13 Dec 2012 16:52 #6069

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
The params & now updated attribs fields are for storing parameters. For instance, whether or not to show a title, description, make an item featured or alike... Think of when you configure an article for instance... You type your content and so on but then you decide if you want to display the author, modified and so on.

As Jocelyn said, this is all now handled in JSON string like;
{
"key" : "value",
"key2" : "value2"
}

You should think of this as for storing configuration overrides as opposed to data as unless you iterate through the object once you get if from you SQL query, it's not as immediately available to you as your 'usual' data fields. For this reason, data stored inside a JSON object in a field is not searchable as easily.

Just to re-iterate, params/attribs is the place to store data that your layout and other 'options' might depend on as opposed to data itself.

Contrary to this, if you were running a heavily ajax'd application/component, storing string data in a JSON obj in this way could be a massive advantage. The downside of tis is serverside/database level validation... Of course, you can iterate through the object and check for types/values but that's an extra step to the norm using regular data fields.

Anyway, hope that this is of some use...

Gez

P.S. I'm not sure if cook is yet setup to handle dealing with JSON stored in the params fields as yet so if you did want to use them for they're usual use, you'd have to update you model's SQL queries... There's plenty of info on that on docs.joomla.org
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Params column in every table? 13 Dec 2012 17:31 #6071

Gez,
firstly, thank you...I understand what the column is "for", but was puzzled about where/how to use it. My biggest challenge has been figuring out what is new in Joomla 2.5, and what Cook Builder is using, or doing.

In this case, I would definitely like to use the params column for record specific overrides, but am not clear how to do it with my component because I can't find any samples in the generated code to learn from. Subsequently searching Joomla code gets me quite confused because J2.5 is new to me, and as you might imagine, the term "params" is used in countless places throughout Joomla.

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

Re: Params column in every table? 13 Dec 2012 22:00 #6073

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Hi @gdpodesta,

Sorry, it wasn't my intention to come across as high-handed! - if I did ;)

gdpodesta wrote: I would definitely like to use the params column for record specific overrides, but am not clear how to do it with my component because I can't find any samples in the generated code to learn from. Subsequently searching Joomla code gets me quite confused because J2.5 is new to me, and as you might imagine, the term "params" is used in countless places throughout Joomla.

Me too!!!

Some great info here: Developing a Model-View-Controller - Part 13

Anyway, Hope it helps and would love to hear any of your experiences!

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The following user(s) said Thank You: gdpodesta

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

Last edit: by JoomGuy. Reason: Fixed broken link

Re: Params column in every table? 13 Dec 2012 22:38 #6074

None of your replies have been anything but helpful, so no apology necessary. I'm residing in this world of knowing what's going on, just really, really fuzzy on how it's happening, so don't always understand things that are "just known", lol. Anyways, I must say that I'm leaps and bounds ahead of where I would have other been with J2.5 with full thanks to the folks on this forum, and specifically to Cook, so you'll never hear me complaining.
The following user(s) said Thank You: admin

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

Re: Params column in every table? 14 Dec 2012 16:42 #6086

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
About params/attribs... I am late, and it is not so dificult to handle. Must also check what can be handled at maximum with the Joomla framework classes (JRegistry, or something else), and then overload it to get some extra functionalities 'Cook made' as usual.

@gdpodesta : Thank you so mush for your review and if you are fullfilled with cook, don't forget to review on JED.
Thank you so much for this growing community, with always a lot of inputs that are pushing me on to improve the service until the sky.
Coding is now a piece of cake

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

Re: Params column in every table? 14 Jan 2013 09:48 #6442

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
@gdopesta did you get this sorted from the docs link I gave?

If not, I just posted a basic outline on how to work with (bind/load) params: www.j-cook.pro/forum/9-coding-inside-you...d-a-work-with-params

Hope it helps!

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

  • Page:
  • 1
Time to create page: 0.074 seconds

  I am so so so looking forward to see how far this can go. Seems like the skies the limit at the moment.
Kevin (Forum) 

Get Started