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


PHP Paginator::make方法代码示例

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


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

示例1: getIndex

 public function getIndex()
 {
     if ($this->access['is_view'] == 0) {
         return Redirect::to('')->with('message', SiteHelpers::alert('error', ' Your are not allowed to access the page '));
     }
     // Filter sort and order for query
     $sort = !is_null(Input::get('sort')) ? Input::get('sort') : 'id';
     $order = !is_null(Input::get('order')) ? Input::get('order') : 'asc';
     // End Filter sort and order for query
     // Filter Search for query
     $filter = !is_null(Input::get('search')) ? $this->buildSearch() : '';
     // End Filter Search for query
     $filter .= " AND id !='1' AND tb_groups.level >= " . Session::get('gid') . "";
     $page = Input::get('page', 1);
     $params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter);
     // Get Query
     $results = $this->model->getRows($params);
     $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
     $pagination = Paginator::make($results['rows'], $results['total'], $params['limit']);
     $this->data['rowData'] = $results['rows'];
     $this->data['pagination'] = $pagination;
     $this->data['pager'] = $this->injectPaginate();
     $this->data['i'] = $page * $params['limit'] - $params['limit'];
     $this->data['tableGrid'] = $this->info['config']['grid'];
     $this->data['tableForm'] = $this->info['config']['forms'];
     $this->data['colspan'] = SiteHelpers::viewColSpan($this->info['config']['grid']);
     $this->data['access'] = $this->access;
     $this->layout->nest('content', 'users.index', $this->data)->with('menus', SiteHelpers::menus());
 }
开发者ID:buguelos,项目名称:make,代码行数:29,代码来源:UsersController.php

示例2: post_index

 public function post_index()
 {
     $buscado = Input::get('buscar');
     $query = DB::query('
         SELECT x.concepto, d.precio_unitario, fxp.folio_fxp, fxp.fecha_expedicion, p.nombre, m.clave, m.nombre as material
         FROM (
             SELECT concepto,MAX(fxp.fecha_expedicion) AS max_date
             FROM detalle_fxp d
             INNER JOIN facturasxpagar fxp ON fxp.id = d.fxp_id
             GROUP BY concepto
         ) AS x
         INNER JOIN facturasxpagar fxp ON fxp.fecha_expedicion = x.max_date
         INNER JOIN detalle_fxp d ON d.fxp_id = fxp.id AND d.concepto = x.concepto
         INNER JOIN proveedores p ON p.id = fxp.proveedor_id
         LEFT JOIN materiales m ON d.material_id = m.id
         WHERE x.concepto LIKE ?
         OR m.clave LIKE ?
         OR m.nombre LIKE ?
         OR p.nombre LIKE ?
         ;', array($buscado . "%", $buscado . "%", $buscado . "%", $buscado . "%"));
     //        var_dump($query);
     //        echo '<pre>';
     //        print_r($query);
     //        echo '</pre>';
     $costos = Paginator::make($query, count($query), PER_PAGE_LARGE);
     $this->data['costos'] = $costos;
     return View::make('admin.' . $this->views . '.index', $this->data);
 }
开发者ID:rmachuca89,项目名称:tests,代码行数:28,代码来源:costos.php

示例3: postData

 public function postData()
 {
     if ($this->access['is_view'] == 0) {
         echo SiteHelpers::alert('error', Lang::get('core.note_restric'));
         die;
     }
     $sort = !is_null(Input::get('sort')) ? Input::get('sort') : $this->info['setting']['orderby'];
     $order = !is_null(Input::get('order')) ? Input::get('order') : $this->info['setting']['ordertype'];
     $filter = !is_null(Input::get('search')) ? $this->buildSearch() : '';
     $page = Input::get('page', 1);
     $master = $this->buildMasterDetail();
     $filter .= $master['masterFilter'];
     $params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : $this->info['setting']['perpage'], 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
     $results = $this->model->getRows($params);
     $this->data['param'] = $params;
     $this->data['rowData'] = $results['rows'];
     $this->data['tableGrid'] = $this->info['config']['grid'];
     $this->data['tableForm'] = $this->info['config']['forms'];
     $this->data['access'] = $this->access;
     $this->data['subgrid'] = isset($this->info['config']['subgrid']) ? $this->info['config']['subgrid'] : array();
     $this->data['masterdetail'] = $this->masterDetailParam();
     // Build pagination setting
     $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
     $pagination = Paginator::make($results['rows'], $results['total'], $params['limit']);
     // Build Pagination
     $this->data['pagination'] = $pagination;
     // Build pager number and append current param GET
     $this->data['pager'] = $this->injectPaginate();
     // Row grid Number
     $this->data['i'] = $page * $params['limit'] - $params['limit'];
     return View::make('aorderdetails.table', $this->data);
 }
开发者ID:blackorwhite1233,项目名称:fakekinhdoanh,代码行数:32,代码来源:AorderdetailsController.php

示例4: getHomePageList

 public static function getHomePageList($category_id)
 {
     $total = static::where('forumtopics.forumcategory_id', '=', $category_id)->count();
     $per_page = Config::get('forums::forums.topics_per_page');
     $page = Paginator::page($total, $per_page);
     $topics = DB::query('SELECT 
         forumtopics.id as id,
         forumtopics.title as title,
         forumtopics.slug as slug,
         forumtopics.nb_messages as nb_messages,
         forumtopics.nb_views as nb_views,
         forumtopics.sticky as sticky,
         forumtopics.created_at as created_at,
         topicusers.username as topic_username,
         fm.id as last_message_id,
         fm.created_at as last_message_date,
         users.username as last_message_username
     FROM forumtopics
     JOIN (SELECT forummessages.id, forummessages.user_id, forummessages.forumtopic_id, forummessages.created_at FROM forummessages ORDER BY forummessages.created_at DESC) as fm
     ON fm.forumtopic_id = forumtopics.id
     JOIN users ON fm.user_id = users.id
     JOIN users as topicusers ON forumtopics.user_id = topicusers.id
     WHERE forumtopics.forumcategory_id = ? 
     GROUP BY fm.forumtopic_id
     ORDER BY forumtopics.sticky DESC, fm.created_at DESC
     LIMIT ' . ($page - 1) * $per_page . ', ' . $per_page, array($category_id));
     return Paginator::make($topics, $total, $per_page);
 }
开发者ID:marmaray,项目名称:OLD-laravel-France-website,代码行数:28,代码来源:forumtopic.php

示例5: getIndex

 public function getIndex()
 {
     if ($this->access['is_view'] == 0) {
         return Redirect::to('')->with('message', SiteHelpers::alert('error', ' Your are not allowed to access the page '));
     }
     // Filter sort and order for query
     $sort = !is_null(Input::get('sort')) ? Input::get('sort') : '';
     $order = !is_null(Input::get('order')) ? Input::get('order') : 'asc';
     // End Filter sort and order for query
     // Filter Search for query
     $filter = !is_null(Input::get('search')) ? $this->buildSearch() : '';
     // End Filter Search for query
     $page = Input::get('page', 1);
     $params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
     // Get Query
     $results = $this->model->getRows($params);
     // Build pagination setting
     $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
     $pagination = Paginator::make($results['rows'], $results['total'], $params['limit']);
     $this->data['rowData'] = $results['rows'];
     // Build Pagination
     $this->data['pagination'] = $pagination;
     // Build pager number and append current param GET
     $this->data['pager'] = $this->injectPaginate();
     // Row grid Number
     $this->data['i'] = $page * $params['limit'] - $params['limit'];
     // Grid Configuration
     $this->data['tableGrid'] = $this->info['config']['grid'];
     $this->data['tableForm'] = $this->info['config']['forms'];
     $this->data['colspan'] = SiteHelpers::viewColSpan($this->info['config']['grid']);
     // Group users permission
     $this->data['access'] = $this->access;
     // Render into template
     $this->layout->nest('content', 'rinvoices.index', $this->data)->with('menus', SiteHelpers::menus());
 }
开发者ID:blackorwhite1233,项目名称:fakekinhdoanh,代码行数:35,代码来源:RinvoicesController.php

示例6: links

 public function links()
 {
     if (count($this->results) <= 0) {
         $this->getResult();
     }
     return \Paginator::make($this->results, count($this->results), static::$app['config']->get('statistics::paginate_num'))->links();
 }
开发者ID:davin-bao,项目名称:statistics,代码行数:7,代码来源:StatisticsStatistic.php

示例7: select

 public function select()
 {
     $pagination = $this->_config['pagination'];
     $search = $this->_config['search'];
     $whereList = '';
     if (ake('whereList', $this->_config)) {
         $whereList = $this->_config['whereList'];
     }
     $order = !strlen($this->_request->getCrudOrder()) ? $this->_config['defaultOrder'] : $this->_request->getCrudOrder();
     $orderDirection = !strlen($this->_request->getCrudOrderDirection()) ? $this->_config['defaultOrderDirection'] : $this->_request->getCrudOrderDirection();
     $export = !strlen($this->_request->getCrudTypeExport()) ? null : $this->_request->getCrudTypeExport();
     $offset = !strlen($this->_request->getCrudNumPage()) ? 0 : $this->_request->getCrudNumPage() * $this->_config['itemsByPage'];
     $limit = $this->_config['itemsByPage'];
     $where = !strlen($this->_request->getCrudWhere()) ? '' : Project::makeQuery($this->_request->getCrudWhere(), $this->_type);
     $data = Project::query($this->_type, $where, 0, 0, $order, $orderDirection);
     $count = count($data);
     if (true === $pagination) {
         $pageNumber = $offset / $limit < 1 ? 1 : $offset / $limit;
         $paginator = Paginator::make($data, $count, $limit);
         $this->_items = $paginator->getItemsByPage($pageNumber);
         $this->_pagination = Crud::pagination($paginator);
     } else {
         $this->_items = $data;
     }
     if (0 < $count && null !== $export) {
         $method = 'export' . ucfirst(Inflector::lower($export));
         return Crud::$method($data, $this->_em);
     }
     if (true === $search) {
         $this->makeSearch();
     }
     return $this;
 }
开发者ID:schpill,项目名称:thin,代码行数:33,代码来源:Listing.php

示例8: itemsIndex

 public function itemsIndex()
 {
     $total = 125;
     $items = range(1, $total);
     $paginated = Paginator::make($items, $total, $this->per_page);
     $data = $this->buildPaginationResponse($paginated);
     return $this->respondOk($data);
 }
开发者ID:edgarsandi,项目名称:le-testing-api-with-behat-laravel,代码行数:8,代码来源:TestController.php

示例9: getPaginator

 public function getPaginator()
 {
     if (!$this->paginator) {
         $items = $this->getCollection()->toArray();
         $this->paginator = \Paginator::make($items, $this->getTotalRowsCount(), $this->page_size);
     }
     return $this->paginator;
 }
开发者ID:creativify,项目名称:Grids,代码行数:8,代码来源:DbalDataProvider.php

示例10: index

 /**
  * Article'ları listele
  * GET /admin/article
  */
 public function index()
 {
     $page = Input::get('page', 1);
     // Config öğesine talip ol
     $perPage = 3;
     $pagiData = $this->article->byPage($page, $perPage, true);
     $articles = Paginator::make($pagiData->items, $pagiData->totalItems, $perPage);
     $this->layout->content = View::make('admin.article_list')->with('articles', $articles);
 }
开发者ID:marmaray,项目名称:Implementing-Laravel,代码行数:13,代码来源:ArticleController.php

示例11: home

 /**
  * Paginated articles
  * GET /
  */
 public function home()
 {
     $page = Input::get('page', 1);
     // Candidate for config item
     $perPage = 3;
     $pagiData = $this->article->byPage($page, $perPage);
     $articles = Paginator::make($pagiData->items, $pagiData->totalItems, $perPage);
     $this->layout->content = View::make('home')->with('articles', $articles);
 }
开发者ID:xenxa,项目名称:Implementing-Laravel,代码行数:13,代码来源:ContentController.php

示例12: getSnippets

 /**
  * Show listing of snippets of a user
  * GET /profiles/{slug}/snippets
  */
 public function getSnippets($slug)
 {
     $page = Input::get('page', 1);
     // Candidate for config item
     $perPage = 10;
     $pagiData = $this->snippet->byAuthor($slug, $page, $perPage);
     $user = $pagiData->user;
     $snippets = Paginator::make($pagiData->items, $pagiData->totalItems, $perPage);
     return View::make('users.snippets', compact('snippets', 'user'));
 }
开发者ID:gamerwalt,项目名称:laravelsnippets,代码行数:14,代码来源:UserController.php

示例13: getIndex

 /**
  * Show listing of snippets
  * GET /snippets
  */
 public function getIndex()
 {
     $page = Input::get('page', 1);
     // Candidate for config item
     $perPage = 30;
     $pagiData = $this->snippet->byPage($page, $perPage);
     $snippets = Paginator::make($pagiData->items, $pagiData->totalItems, $perPage);
     $tags = $this->tag->all();
     $topSnippetContributors = $this->user->getTopSnippetContributors();
     return View::make('snippets.index', compact('snippets', 'tags', 'topSnippetContributors'));
 }
开发者ID:gamerwalt,项目名称:laravelsnippets,代码行数:15,代码来源:SnippetController.php

示例14: _createPaginator

 /**
  * (non-PHPdoc)
  * @see \Mawelous\Yamop\Mapper::_createPaginator()
  */
 protected function _createPaginator($results, $totalCount, $perPage, $page, $options)
 {
     if ($options) {
         \Paginator::setPageName($options);
         $paginator = \Paginator::make($results, $totalCount, $perPage);
         \Paginator::setPageName('page');
     } else {
         $paginator = \Paginator::make($results, $totalCount, $perPage);
     }
     return $paginator;
 }
开发者ID:mawelous,项目名称:yamop-laravel,代码行数:15,代码来源:Mapper.php

示例15: getIndex

 public function getIndex()
 {
     if ($this->access['is_view'] == 0) {
         return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric')));
     }
     // Filter sort and order for query
     $sort = !is_null(Input::get('sort')) ? Input::get('sort') : 'slideshow_id';
     $order = !is_null(Input::get('order')) ? Input::get('order') : 'asc';
     // End Filter sort and order for query
     // Filter Search for query
     $filter = !is_null(Input::get('search')) ? $this->buildSearch() : '';
     $filter .= " AND lang = '{$this->lang}'";
     // End Filter Search for query
     // Take param master detail if any
     $master = $this->buildMasterDetail();
     // append to current $filter
     $filter .= $master['masterFilter'];
     $page = Input::get('page', 1);
     $params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
     // Get Query
     $results = $this->model->getRows($params);
     // Build pagination setting
     $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
     $pagination = Paginator::make($results['rows'], $results['total'], $params['limit']);
     $test = $this->model->columnTable();
     $arr_search = SiteHelpers::arraySearch(Input::get('search'));
     foreach ($arr_search as $key => $val) {
         if ($key != "sort" && $key != "order" && $key != "rows") {
             $test[$key]['value'] = $val;
         }
     }
     $this->data['test'] = $test;
     $this->data['rowData'] = $results['rows'];
     // Build Pagination
     $this->data['pagination'] = $pagination;
     // Build pager number and append current param GET
     $this->data['pager'] = $this->injectPaginate();
     // Row grid Number
     $this->data['i'] = $page * $params['limit'] - $params['limit'];
     // Grid Configuration
     $this->data['tableGrid'] = $this->info['config']['grid'];
     $this->data['tableForm'] = $this->info['config']['forms'];
     $this->data['colspan'] = SiteHelpers::viewColSpan($this->info['config']['grid']);
     // Group users permission
     $this->data['access'] = $this->access;
     // Detail from master if any
     $this->data['masterdetail'] = $this->masterDetailParam();
     $this->data['details'] = $master['masterView'];
     // Master detail link if any
     $this->data['subgrid'] = isset($this->info['config']['subgrid']) ? $this->info['config']['subgrid'] : array();
     // Render into template
     $this->layout->nest('content', 'Slideshow.index', $this->data)->with('menus', SiteHelpers::menus());
 }
开发者ID:blackorwhite1233,项目名称:fakekinhdoanh,代码行数:53,代码来源:SlideshowController.php


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