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;
到目前爲止,我只顯示收到的消息和分頁視圖,它是工作的罰款。不過,我想實現一個標籤容器,以在同一頁面上顯示收到和發送的項目。
我在摸我的腦袋,想知道如何使用每個標籤的分頁方面,而不影響兩個標籤。使用現有方法的最佳方向是什麼?也許拋出一個附加參數到當標籤被選中的網址...
感謝