當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Paging::records方法代碼示例

本文整理匯總了PHP中Paging::records方法的典型用法代碼示例。如果您正苦於以下問題:PHP Paging::records方法的具體用法?PHP Paging::records怎麽用?PHP Paging::records使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Paging的用法示例。


在下文中一共展示了Paging::records方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: showBlog

 public function showBlog()
 {
     //Get the page that we are on
     $page = Input::get('page') ? Input::get('page') : 1;
     $records_per_page = 10;
     //Get the artivles that we are going to display
     $data['articles'] = Tools::getBlogPosts($page, $records_per_page);
     // instantiate the pagination object
     $pagination = new Paging();
     // the number of total records is the number of records in the array
     $pagination->records(count($data['articles']));
     //$pagination->records(500);
     // records per page
     $pagination->records_per_page($records_per_page);
     $data['pagination'] = $pagination;
     //Create the view
     $this->layout->content = View::make('blog.blog', $data);
     $this->layout->header = View::make('includes.header');
     $headerData = array('title' => isset($this->metaData['blog_title']) ? $this->metaData['blog_title'] : null, 'description' => isset($this->metaData['blog_desc']) ? $this->metaData['blog_desc'] : null);
     $this->layout->header = View::make('includes.header', $headerData);
 }
開發者ID:alexanderpetrob89,項目名稱:fei.edu,代碼行數:21,代碼來源:BlogController.php


注:本文中的Paging::records方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。