What's the purpose of $this->get('Item') in view.html.php? - Joomla! Forum - community, help and support


i refer code below in http://docs.joomla.org/j2.5:developing_ ... e_function:

code: select all

class helloworldviewupdhelloworld extends jview
{
    // overwriting jview display method
    function display($tpl = null)
    {
            $app            = jfactory::getapplication();
            $params         = $app->getparams();
            $dispatcher = jdispatcher::getinstance();

            // data models
            $state          = $this->get('state');
            $item           = $this->get('item');  //what purpose of statement?
            $this->form     = $this->get('form');

            // check errors.
            if (count($errors = $this->get('errors')))
            {
                    jerror::raiseerror(500, implode('<br />', $errors));
                    return false;
            }
            // display view
            parent::display($tpl);
    }
}


i don't understand purpose of statement , notice $item not appear in code in file site/views/updhelloworld/tmpl/default.php on webpage.

i have same question view.html.php file of com_users/views/registration of joomla 3 code ( thought comparing 2 form submit examples answer question):

code: select all

$this->data     = $this->get('data'); //what purpose of statement? precisely kind of data meant here?
    $this->form     = $this->get('form');
    $this->state    = $this->get('state');
    $this->params   = $this->state->get('params');

and here $this->data not appear in related tmpl/default.php file (?)

$item = $this->get('item'); //what purpose of statement?
this refers getitem() method in model. please note warning @ top of tutorial methods not adhering best practices.

$this->data = $this->get('data'); //what purpose of statement? precisely kind of data meant here?
it gets registration form data using method getdata() model





Comments

Popular posts from this blog

Assign one article to one user - Joomla! Forum - community, help and support

Joomla 3.3 Installation Error message - Joomla! Forum - community, help and support

Catalogue Size