I want to know how can I pass data from joomla view to joomla template. How can I pass multiple variables?
class CareerformViewCareerform extends JView
{
protected $state;
protected $item;
function display($tpl = null)
{
$app = JFactory::getApplication();
$params = $app->getParams();
// Get some data from the models
$state = $this->get('State');
$item = $this->get('Item');
$newvar="Something";
$success_message="Thanks for your interest";
parent::display($tpl);
}
}
I want to pass $newvar and $success_message to template; how can I pass them?
We can pass view data to template by using:
Please note that
assignRefpass second param by reference and we can retrieve it asnot just
$var1but$this->var1