I have the 2nd line...and it doesn't work...Sometimes I have error message like this :
Quote:
Trying to get property of non-object in C:\Program Files (x86)\EasyPHP5.3.0\www\totosicocm\components\com_content\views\frontpage\view.html.php on line 123
In my model I have :
Code:
function __construct()
{
parent::__construct();
global $mainframe, $option;
$this->setState('limit', $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'));
$this->setState('limitstart', JRequest::getVar('limitstart', 0, '', 'int'));
// In case limit has been changed, adjust limitstart accordingly
$this->setState('limitstart', ($this->getState('limit') != 0 ? (floor($this->getState('limitstart') / $this->getState('limit')) * $this->getState('limit')) : 0));
}
/**
* Method to get item data
*/
function getData()
{
if (empty($this->_data))
{
$query = $this->_buildQuery();
$this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit'));
}
return $this->_data;
}
/**
* Method to get the total number of items
*
*/
function getTotal()
{
if (empty($this->_total))
{
$query = $this->_buildQuery();
$this->_total = $this->_getListCount($query);
}
return $this->_total;
}
/**
* Method to get a pagination object
*/
function getPagination()
{
if (empty($this->_pagination))
{
jimport('joomla.html.pagination');
$this->_pagination = new JPagination( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') );
}
return $this->_pagination;
}
In my Default :
Code:
<tfoot class="paginate">
<tr>
<td colspan="8" >
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
In view.html :
Code:
$items =& $this->get('data');
$total = & $this->get( 'Total');
$pagination = & $this->get( 'Pagination' );
If someone can help me, I will be very pleased...
thanks
Thierry