references:joomla.framework:application:jmodel-getstategetState
Retrieves model state variables. This method will either return the value of a specified state variable, or will return a reference to the JObject object that is used to store the model’s state variables. Syntaxmixed getState ( $property )
ExamplesExample jimport( 'joomla.application.component.model' ); class HelloModelHellos extends JModel { function __construct() { $config = array( 'name' => 'MyModel', 'table_path' => JPATH_COMPONENT.DS.'tables' ); parent::__construct( $config ); } } $model =& JModel::getInstance( 'hellos', 'HelloModel' ); $model->setState( 'filter', 'value1' ); echo $model->getState( 'filter' )."\n"; $states =& $model->getState(); echo $states->get('filter'); might produce Result value1 value1 |


