Can't seem to figure out what's causing this error message. I think it might have to do with my controller though.
admin/controller.php
Code:
<?php
defined('_JEXEC') or die ('restricted access');
jimport('joomla.application.component.controller');
class CbcolaController extends JController
{
function display ()
{
/*echo "the display() function of the controller :) <br />";*/
//get a refrence of the page instance in joomla
$document=& JFactory::getDocument();
//get the view name from the query string
$viewName = JRequest::getVar('view', 'registration');
$viewType= $document->getType();
//get our view
$view = &$this->getView($viewName, $viewType);
//get the model
$model = &$this->getModel($viewName, 'ModelCbcola');
//some error chec
if (!JError::isError($model))
{
$view->setModel ($model, true);
}
//set the template and display it
$view->setLayout('default');
$view->display();
}
}
?>
admin/controllers/registration.php
Code:
<?php
defined('_JEXEC') or die ('restricted access');
jimport('joomla.application.component.controller');
class CbcolaControllerRegistration extends CbcolaController
{
function display ()
{
//get a refrence of the page instance in joomla
$document=& JFactory::getDocument();
//get the view name from the query string
$viewName = JRequest::getVar('view', 'registration');
$viewType= $document->getType();
//get our view
$view = &$this->getView($viewName, $viewType);
//get the model
$model = &$this->getModel('Registration', 'ModelCbcola');
//some error chec
if (!JError::isError($model))
{
$view->setModel ($model, true);
}
//set the template and display it
$view->setLayout('default');
$view->display();
}
}
?>
admin/models/registration.php
Code:
<?php
defined('_JEXEC') or die ('restrinced access');
jimport('joomla.application.component.model');
class CbcolaModelRegistration extends JModel
{
var $_query = null;
function __construct()
{
parent::__construct();
}
function Pages()
{
$query = ' SELECT * FROM jos_CB_Cola';
$query = mysql_query($query);
$this->_query = $query;
return $this->_query;
}
}
?>
error message:
Fatal error: Call to a member function getName() on a non-object in /home/account6/public_html/MedTech/libraries/joomla/application/component/view.php on line 449