当前位置: 首页>>代码示例>>PHP>>正文


PHP Paginator::per_page方法代码示例

本文整理汇总了PHP中Paginator::per_page方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::per_page方法的具体用法?PHP Paginator::per_page怎么用?PHP Paginator::per_page使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Paginator的用法示例。


在下文中一共展示了Paginator::per_page方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action_index

 public function action_index()
 {
     $category_uri = $this->request->param('category_uri');
     $news_category = new News_Category();
     $category_list = $news_category->get_list($this->page_id);
     if (empty($category_list)) {
         throw new HTTP_Exception_404();
     }
     $category_orm = $news_category->by_uri($category_list, $category_uri);
     $orm = ORM::factory('news')->where('category_id', 'IN', array_keys($category_list));
     if ($category_orm) {
         $orm->where('category_id', '=', $category_orm->id);
         $properties = $news_category->get_properties(array($category_orm));
         $properties = reset($properties);
         $this->title = $category_orm->title;
         $this->breadcrumbs[] = array('title' => $category_orm->title);
     } else {
         $orm_helper = ORM_Helper::factory('page', $this->page_id);
         $properties = $orm_helper->property_list();
     }
     $paginator_orm = clone $orm;
     $paginator = new Paginator('layout/paginator');
     $paginator->per_page($this->limit)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all()->as_array();
     $titlebar_title = Arr::path($properties, 'Title.value');
     if (empty($titlebar_title)) {
         $titlebar_title = __('Blog');
     }
     $this->template->set_filename('modules/news/list')->set('list', $list)->set('paginator', $paginator)->set('categories', $category_list)->set('properties', $properties)->set('titlebar_title', $titlebar_title);
 }
开发者ID:greor,项目名称:satin-spb,代码行数:31,代码来源:news.php

示例2: action_index

 public function action_index()
 {
     $this->_parse_uri();
     $category_id = (int) $this->category->id;
     $list_categories = ORM::factory('catalog_Category')->where('category_id', '=', $category_id)->find_all()->as_array();
     $elements_orm = ORM::factory('catalog_Element')->where('category_id', '=', $category_id);
     $paginator_orm = clone $elements_orm;
     $paginator = new Paginator('layout/paginator');
     $paginator->per_page($this->limit)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $elements_orm->paginator($paginator)->find_all()->as_array();
     $properties = array();
     if (!empty($category_id)) {
         $property_helper = ORM_Helper::factory('catalog_Category', $category_id)->property_helper();
         $property_helper->set_owner_id($category_id);
         $properties = $property_helper->get_list();
         $titlebar_title = Arr::path($properties, 'Title.value');
         if (empty($titlebar_title)) {
             $titlebar_title = $this->category->title;
         }
     } else {
         $orm_helper = ORM_Helper::factory('page', $this->page_id);
         $properties = $orm_helper->property_list();
         $titlebar_title = Arr::path($properties, 'Title.value');
         if (empty($titlebar_title)) {
             $titlebar_title = __('Categories of goods');
         }
     }
     $this->template->set_filename('modules/catalog/list')->set('list_categories', $list_categories)->set('list', $list)->set('paginator', $paginator)->set('properties', $properties)->set('titlebar_title', $titlebar_title);
 }
开发者ID:greor,项目名称:satin-spb,代码行数:30,代码来源:catalog.php

示例3: action_index

 public function action_index()
 {
     $orm = ORM::factory('video');
     $this->_apply_filter($orm);
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('modules/video/element/list')->set('list', $list)->set('hided_list', $this->get_hided_list($orm->object_name()))->set('filter_type_options', $this->filter_type_options)->set('paginator', $paginator);
     $this->left_menu_element_add();
     $this->sub_title = __('List');
 }
开发者ID:greor,项目名称:kohana-video,代码行数:13,代码来源:element.php

示例4: action_index

 public function action_index()
 {
     $orm = ORM::factory('news_Category')->where('page_id', '=', $this->module_page_id);
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('modules/news/category/list')->set('list', $list)->set('hided_list', $this->get_hided_list($orm->object_name()))->set('not_deleted_categories', $this->not_deleted_categories)->set('paginator', $paginator);
     $this->left_menu_category_add($orm);
     $this->left_menu_category_fix($orm);
     $this->title = __('Categories');
 }
开发者ID:greor,项目名称:kohana-news,代码行数:13,代码来源:category.php

示例5: action_index

 public function action_index()
 {
     $orm = ORM::factory('site');
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('sites/list')->set('paginator', $paginator)->set('list', $list);
     $this->title = __('Sites list');
     if ($this->acl->is_allowed($this->user, $orm, 'edit')) {
         $this->left_menu_site_add();
     }
 }
开发者ID:greor,项目名称:satin-spb,代码行数:14,代码来源:sites.php

示例6: action_index

 public function action_index()
 {
     $orm = ORM::factory('photo_Album')->where('group', '=', $this->group_key);
     $this->_apply_filter($orm);
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('modules/photo/album/list')->set('list', $list)->set('hided_list', $this->get_hided_list($orm->object_name()))->set('not_deleted_albums', $this->not_deleted_albums)->set('paginator', $paginator)->set('filter_type_options', $this->filter_type_options);
     $this->left_menu_album_add($orm);
     $this->title = __('Photo albums');
     $this->sub_title = __('List');
 }
开发者ID:greor,项目名称:kohana-photo,代码行数:14,代码来源:album.php

示例7: action_index

 public function action_index()
 {
     $orm = ORM::factory('form');
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('forms/structure/list')->set('list', $list)->set('paginator', $paginator);
     if ($this->acl->is_allowed($this->user, $orm, 'add')) {
         $this->left_menu_form_add();
     }
     $this->title = __('Forms (structure)');
     $this->sub_title = __('List');
 }
开发者ID:greor,项目名称:satin-spb,代码行数:15,代码来源:structure.php

示例8: action_index

 public function action_index()
 {
     $blog_orm = ORM::factory('blog')->where('group', '=', $this->group_key)->and_where('id', '=', $this->blog_id)->find();
     if (!$blog_orm->loaded()) {
         throw new HTTP_Exception_404();
     }
     $orm = ORM::factory('blog_Post')->where('blog_id', '=', $this->blog_id);
     $this->_apply_filter($orm);
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('modules/blog/element/list')->set('list', $list)->set('hided_list', $this->get_hided_list($orm->object_name()))->set('filter_type_options', $this->filter_type_options)->set('paginator', $paginator);
     $this->left_menu_blog_add($blog_orm);
     $this->left_menu_element_list();
     $this->left_menu_element_add();
     $this->title = __('List');
 }
开发者ID:greor,项目名称:kohana-blog,代码行数:19,代码来源:element.php

示例9: action_index

 public function action_index()
 {
     $orm = ORM::factory('admin')->where('delete_bit', '=', 0)->and_where('username', 'NOT IN', $this->_exclude_admins);
     if (in_array($this->user->role, array('main', 'super'))) {
         $orm->where('site_id', '=', SITE_ID);
     } else {
         $orm->where('site_id', '=', $this->user->site_id);
     }
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(10)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('admins/list')->set('list', $list)->set('roles', $this->acl_roles())->set('paginator', $paginator);
     $this->title = __('Admin list');
     if ($this->acl->is_allowed($this->user, $orm, 'edit')) {
         $this->left_menu_user_add();
     }
 }
开发者ID:greor,项目名称:satin-spb,代码行数:19,代码来源:admins.php

示例10: action_index

 public function action_index()
 {
     $album_orm = ORM::factory('photo_Album')->where('group', '=', $this->group_key)->and_where('id', '=', $this->album_id)->find();
     if (!$album_orm->loaded()) {
         throw new HTTP_Exception_404();
     }
     $orm = ORM::factory('photo')->where('owner', '=', $album_orm->object_name())->where('owner_id', '=', $this->album_id);
     $this->_apply_filter($orm);
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('modules/photo/element/list')->set('list', $list)->set('filter_type_options', $this->filter_type_options)->set('paginator', $paginator)->set('acl_album_can_edit', $this->acl->is_allowed($this->user, $album_orm, 'edit'));
     $this->left_menu_album_add($album_orm);
     $this->left_menu_element_list();
     $this->left_menu_element_add($album_orm);
     $this->left_menu_element_fix($orm);
     $this->title = __('List');
 }
开发者ID:greor,项目名称:kohana-photo,代码行数:20,代码来源:element.php

示例11: action_form

 public function action_form()
 {
     $id = (int) Request::current()->param('id');
     $orm_form = ORM::factory('form', $id);
     if (!$orm_form->loaded()) {
         throw new HTTP_Exception_404();
     }
     $paginator_orm = clone $orm_form->responses;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm_form->responses->paginator($paginator)->find_all();
     $this->template->set_filename('forms/responses/form')->set('orm_form', $orm_form)->set('list', $list)->set('paginator', $paginator);
     if ($this->acl->is_allowed($this->user, $orm_form, 'add')) {
         $this->left_menu_form_add();
     }
     if ($this->acl->is_allowed($this->user, $orm_form, 'export_csv')) {
         $this->left_menu_csv_export($orm_form->id);
     }
     $this->title = __('Messages');
     $this->sub_title = __('Form') . ' [ ' . $orm_form->title . ' ]';
     $this->breadcrumbs[] = array('title' => $this->title);
 }
开发者ID:greor,项目名称:satin-spb,代码行数:23,代码来源:responses.php


注:本文中的Paginator::per_page方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。