I then was going to add models and tables without luck.
it's like model getData is never called in the view.
Here is my model code ( /administrator/components/com_aefingatoflur/models/deildir.php)
Code: Select all
jimport( 'joomla.application.component.model' );
class AefingatoflurModelDeildir extends JModel
{
var $_data;
function _buildQuery()
{
$query = ' SELECT * '
. ' FROM #__deildir '
;
return $query;
}
function getData()
{
echo 'test'; //doesn't show up
// Lets load the data if it doesn't already exist
if (empty( $this->_data ))
{
$query = $this->_buildQuery();
$this->_data = $this->_getList( $query );
}
echo 'test'; //doesn't show up
return $this->_data;
}
Code: Select all
jimport( 'joomla.application.component.view');
class AefingatoflurViewDeildir extends JView
{
function display($tpl = null)
{
JToolBarHelper::title( JText::_( 'Deildir' ), 'generic.png' );
JToolBarHelper::deleteList();
JToolBarHelper::editListX();
JToolBarHelper::addNewX();
// new start
// Get data from the model
$items = &$this->get('Data');
$this->assignRef('items', $items);
// new end
parent::display($tpl);
}
}
I read somewhere that classnames should match XxxViewYyyy and XxxModelYyyy which I have followed