本文整理匯總了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);
}