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