What I trying to do: I created a login view which the user access by clicking on a link on my navigation bar. The link I created using the joomla administration site (see attached image). Joomla creates a link which points directly to the view and NOT to the controller. The below code now tries to oull the data model 'language' into the view - without any success.
Code: Select all
class xyzViewLogin extends JView {
function display($tpl = null) {
$model_language = &$this->getModel('language');
$model_login = &$this->getModel('login');
$this->assignRef('label',$model_language->labels);
$this->assignRef('userName', $model_login->userName);
parent::display($tpl);
}
Code: Select all
index.php?option=com_ehive&task=login
Code: Select all
function login() {
$session = JFactory::getSession();
$document =& JFactory::getDocument();
$viewName = JRequest::getVar('view','login');
$model_language = &$this->getModel('language');
$viewType = $document->getType();
$view = &$this->getView($viewName, $viewType);
if (!JError::isError( $model_language )) {
$view->setModel( $model_language, true );
}
$view->setLayout('login');
$view->display();
}
Thanks,
Uwe
What am I missing?
Thanks a lot,
Uwe