Pagination im eigenen Modul
Hallo,
ich versuche derzeit die Pagination-Klasse in meinem eigenen Modul einzubauen, was derzeit aber noch nicht funktioniert. Vll weiß hier jemand rat. :)
PHP-Code:
<?php
class ModuleMixesStart extends ModuleMixes
{
protected $strTemplate = 'mod_mixesstart';
protected function compile()
{
$limit = 6;
$arrMixes = array();
$objMixes = $this->Database->execute("SELECT * FROM tl_mixes ORDER BY datum");
// Pagination
$page = $this->Input->get('page') ? $this->Input->get('page') : 1;
$offset = ($page - 1) * $limit;
// Get total number of comments
$objTotal = $this->Database->prepare("SELECT COUNT(*) AS count FROM tl_mixes")
->execute($this->id);
// Add pagination menu
$objPagination = new Pagination($objTotal->count, $limit);
$this->Template->pagination = $objPagination->generate("\n ");
while ($objMixes->next())
{
$arrMixes[] = array
(
'name' => $objMixes->name,
'datum' => $objMixes->datum,
'img' => $this->getImage($objMixes->img, '120', _),
'id' => $objMixes->id
);
}
$this->Template->mixes = $arrMixes;
}
}
?>
Die Werte "$objTotal->count" und "$limit" stimmen mit den gewünschten überein, daran sollte es nicht liegen.
Viele Grüße