What are state variables in joomla

What is the use of state variables in Joomla? and what is the use $model->setStatein this code (code from the Joomla module mod_articles_popular)?

$model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));
// Set application parameters in model
$app = JFactory::getApplication();
$appParams = $app->getParams();
$model->setState('params', $appParams); 
// Set the filters based on the module params
$model->setState('list.start', 0);
+4
source share
1 answer

The setState method for the model used to filter data, you can read information about here . and function syntax and parameter list can be here .

The main goal of this method is to filter the result set using parameters. in your case its param pair an example message can be found here .

Hope this is clear now.

+1
source

Source: https://habr.com/ru/post/1613866/


All Articles