controller get model state variable - Joomla! Forum - community, help and support


hi,
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

Popular posts from this blog

Upgrade 3.4.8 to 3.5.1 failed "download package failed" - Joomla! Forum - community, help and support

Joomal 3.6.3 update error - PHP temporary folder is not set - Joomla! Forum - community, help and support

Fatal error during instalation - Joomla! Forum - community, help and support