Gustavo Souza
unread,May 1, 2012, 3:49:41 PM5/1/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to kohan...@googlegroups.com
Pessoal, sei que já teve várias duvidas quanto a paginação no Kohana mas continuo sem conseguir fazer tudo.
Minha action_index() está fazendo a busca com o limit e tudo mais, se dou o limite de 2, só retorna 2 e assim por diante. Só que não sei como fazer para ele gerar na minha view os links de paginação.
minha action{
$pagination = Pagination::factory(array(
'total_items' => ORM::factory('new')->count_all(),
'items_per_page' => 2,
'view' => 'admin/new/index',
'auto_hide' => FALSE,
));
$news = ORM::factory('new')
->limit($pagination->items_per_page)
->offset($pagination->offset)
->find_all();
$this -> template -> content = new View('admin/new/index');
$this -> template -> content -> bind('message', $message);
$this -> template -> content -> set("news", $news);
}
Tentei fazer um $this -> template -> content -> set("pagination", $pagination);
E dei um echo $pagination e da erro de __toString();
Utilizo o kohana 3.1
Alguem sabe onde estou errando?
Obrigado.
--
Att,
Gustavo Souza