I refer to the code below, presented in Developing a MVC Component - Front End Function Example:
class HelloWorldViewUpdHelloWorld extends JView
{
// Overwriting JView display method
function display($tpl = null)
{
$app = JFactory::getApplication();
$params = $app->getParams();
$dispatcher = JDispatcher::getInstance();
// Get some data from the models
$state = $this->get('State');
$item = $this->get('Item'); //WHAT IS THE PURPOSE OF THIS STATEMENT?
$this->form = $this->get('Form');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}
// Display the view
parent::display($tpl);
}
}
I don't understand the purpose of this statement and I also notice that $item
does not appear in the code in file site/views/updhelloworld/tmpl/default.php
on that webpage.
I actually have the same question for the view.html.php
file of com_users/views/registration
of Joomla 3 code ( I thought by comparing the two form submit examples I could answer my question):
$this->data = $this->get('Data'); //WHAT IS THE PURPOSE OF THIS STATEMENT? WHAT PRECISELY KIND OF DATA iS MEANT HERE?
$this->form = $this->get('Form');
$this->state = $this->get('State');
$this->params = $this->state->get('params');
And also here $this->data
does not appear in the related tmpl/default.php
file (?)