1
好吧,所以基本上我已经创建了一个简单的页面使用Kohana显示用户的消息收件箱/发件箱使用标签。Kohana分页和JavaScript标签
我的控制器是这样的:
$content = View::factory('messages')->bind('user', $user)->bind('received', $received)->bind('sent', $sent)->bind('pager_links', $pager_links);
$user = Auth::instance()->get_user();
$message_count = ORM::factory('message')->where('to_id', '=', $user)->where('read', '=', '0')->count_all();
$pagination = Pagination::factory(array(
'total_items' => $message_count,
'items_per_page' => 10
));
$received = ORM::factory('messages')->where('messages.to_id', '=', $user)->limit($pagination->items_per_page)->offset($pagination->offset)->find_all();
$sent = ORM::factory('messages')->where('messages.user_id', '=', $user)->limit($pagination->items_per_page)->offset($pagination->offset)->find_all();
$pager_links = $pagination->render();
$this->template->content = $content;
到目前为止,我只显示收到的消息和分页视图,它是工作的罚款。不过,我想实现一个标签容器,以在同一页面上显示收到和发送的项目。
我在摸我的脑袋,想知道如何使用每个标签的分页方面,而不影响两个标签。使用现有方法的最佳方向是什么?也许抛出一个附加参数到当标签被选中的网址...
感谢