controller get model state variable - Joomla! Forum - community, help and support
hi,
i have model set state variables
now wan't access state variables in controller.
i try model , state not work.
i model not state variables
als ausgabe bekomme ich dann:
i try put code populatestate in contructor not work.
can please me how can access state variables model in controller?
regards
martin
i have model set state variables
code: select all
protected function populatestate($ordering = null, $direction = null)
{
// initialise variables.
$app = jfactory::getapplication();
$params = $app->getparams();
$params_array = $params->toarray();
$this->setstate('public_user', $params_array['public_user']);
if( isset($params_array['is_public'] ) ) {
$this->setstate('is_public', $params_array['is_public']);
}
...
now wan't access state variables in controller.
i try model , state not work.
i model not state variables
code: select all
public function controllerfunction()
{
$model =& $this->getmodel();
$is_public = $model->getstate('is_public');
echo "model: $model is_public: $is_public </br>";
...
als ausgabe bekomme ich dann:
code: select all
model: commymodel is_public: </br>
i try put code populatestate in contructor not work.
can please me how can access state variables model in controller?
regards
martin
Comments
Post a Comment