references:joomla.framework:application:jmodel-setstatesetState
Sets model state variables. Model state variables can be used to pass information from the controller to the view and to the model. These values can later be retrieved using JModel::getState(). This method returns the value that is assign to the state variable. Syntaxmixed setState ( $property, $value )
ExamplesExample jimport( 'joomla.application.component.model' ); class PollModelPoll extends JModel { function __construct() { $config = array( 'table_path' => JPATH_COMPONENT.DS.'tables' ); parent::__construct( $config ); } } $model =& JModel::getInstance( 'poll', 'PollModel' ); $model->setState( 'filter', 'value1' ); echo $model->getState( 'filter' ); might produce Result value1 |


