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


PHP LengthAwarePaginator::render方法代码示例

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


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

示例1: makeLengthAware

 /**
  * Create paginator
  *
  * @param  Illuminate\Support\Collection  $collection
  * @param  int     $total
  * @param  int     $perPage
  * @return string
  */
 public static function makeLengthAware($collection, $total, $perPage)
 {
     $paginator = new LengthAwarePaginator($collection, $total, $perPage, Paginator::resolveCurrentPage(), ['path' => Paginator::resolveCurrentPath()]);
     return str_replace('/?', '?', $paginator->render());
 }
开发者ID:aerojun,项目名称:pcmrcritic,代码行数:13,代码来源:Pagination.php

示例2: paginate

 /**
  * paginate to create my table
  *
  *
  * @param $table
  * @param $table_name
  * @return string
  */
 protected function paginate($table, $table_name)
 {
     $paginate = new LengthAwarePaginator($table, count($table), $this->row_per_page, $this->current_page);
     $total_rows = count($table);
     // we should select only posts that we want;
     $table = array_slice($table, $this->current_page * $this->row_per_page - $this->row_per_page, $this->row_per_page);
     $start_id = $this->current_page * $this->row_per_page - $this->row_per_page;
     $start_id++;
     $end_id = $this->current_page * $this->row_per_page;
     if ($end_id > $total_rows) {
         $end_id = $total_rows;
     }
     if ($total_rows == 0) {
         $start_id = 0;
     }
     if ($end_id < $this->row_per_page) {
         $this->row_per_page = $end_id;
     }
     $footer_info = "<div style='margin-top:17px;float:left;' class='footer-data-table-info'>نمایش <b>" . $start_id . "</b> تا <b>" . $end_id . "</b> ، <b>" . $this->row_per_page . "</b> سطر در هر صفحه ، کل سطرها  <b>{$total_rows}</b></div>";
     return json_encode([$table_name => $table, "paginate" => $paginate->render(), "page_id" => $this->current_page, "row_per_page" => $this->row_per_page, "start_id" => $start_id, "footer_info" => $footer_info, "random" => $this->random_number]);
 }
开发者ID:mkdesignn,项目名称:datagridview,代码行数:29,代码来源:DataGridViewController.php

示例3: render

 public function render($class = null)
 {
     return $this->paginator->render(static::$defaultView);
 }
开发者ID:laravolt,项目名称:support,代码行数:4,代码来源:SemanticUiPaginator.php

示例4: respondWithPaginated

 public function respondWithPaginated(LengthAwarePaginator $paginated, $status = 200)
 {
     $this->options['paginationCode'] = $paginated->render();
     $this->prepareEloquentResult($paginated);
     return $this->respond(collect($paginated), $status);
 }
开发者ID:efrane,项目名称:transfugio,代码行数:6,代码来源:ResponseBuilder.php


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