Joomla component parameters - Do it your way!
First of all, an acknowledgment. I can’t take credit for this information as I found it on another blog: http://onestoryeveryday.com/joomla-component-parameter-save-and-persist.html. But I felt that the post was so good it was worth repeating just to get the information out there! If you want to be able to save component parameters in Joomla, outside of the normal methods, read on.
I wanted to do this as you cannot use WYSIWYG editors in the standard Joomla parameters save window. So I created my own view to do this, but how do you save the params I hear you say. To do so just use the following block of code:
$table =& JTable::getInstance('component'); $table->loadByOption( 'com_yourComponentName' ); $post['option'] = 'com_yourComponentName'; $post['params']['website']='testdddd'; $post['params']['website1']='testdddd'; $table->bind( $post ); $table->store();
This gets an instance of the jos_components table and then gets the row for your component. You can then save any parameters you like to the row, which can be accessed later by the normal parameter get methods!
That bit of code made my day a hell of a lot easier, maybe it’ll help you too!