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


PHP Pagination::create_links方法代码示例

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


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

示例1: paginationHelper

 /**
  *
  *@param string $number the amount you want to convert to kobo
  *@return string formatted string
  *
  */
 static function paginationHelper($paginate_obj, $base_url)
 {
     if (is_object($paginate_obj)) {
         $config['per_page'] = count($paginate_obj->items);
         $config['full_tag_open'] = '<ul class="pagination">';
         $config['full_tag_close'] = '</ul>';
         $config['cur_tag_open'] = '<li class="active"><a href="#">';
         $config['cur_tag_close'] = '</a></li>';
         $config['next_tag_open'] = '<li>';
         $config['next_tag_close'] = '</li>';
         $config['prev_tag_open'] = '<li>';
         $config['prev_tag_close'] = '</li>';
         $config['num_tag_open'] = '<li>';
         $config['num_tag_close'] = '</li>';
         $config['last_tag_open'] = '<li>';
         $config['last_tag_close'] = '</li>';
         $config['first_tag_open'] = '<li>';
         $config['first_tag_close'] = '</li>';
         $config['first_link'] = 'First';
         $config['last_link'] = 'Last';
         $config['next_link'] = 'Next';
         $config['prev_link'] = 'Previous';
         $config['use_page_numbers'] = true;
         $config['num_links'] = 9;
         $config['cur_page'] = $paginate_obj->current;
         $config['base_url'] = $base_url;
         $config['total_rows'] = $paginate_obj->total_items;
         $pagination = new Pagination();
         $pagination->initialize($config);
         echo $pagination->create_links();
     }
 }
开发者ID:Nnadozieomeonu,项目名称:lacecart,代码行数:38,代码来源:Utils.php

示例2: action_index

 public function action_index()
 {
     $config = array('pagination_url' => 'admin/users/index', 'total_items' => DB::count_records('users'), 'uri_segment' => 4);
     Pagination::set_config($config);
     $data['posts'] = Model_User::find('all', array('related' => array('profiles'), 'limit' => Pagination::$per_page, 'offset' => Pagination::$offset, 'order_by' => array(array('id', 'desc'))));
     $data['pager'] = Pagination::create_links();
     $this->template->title = "Users";
     $this->template->content = View::forge('admin/users/index', $data, false);
 }
开发者ID:nobuhiko,项目名称:mylogbook,代码行数:9,代码来源:users.php

示例3: action_location

 public function action_location()
 {
     $config = array('pagination_url' => 'user/' . $this->username . '/year/' . $this->param('location'), 'uri_segment' => 5);
     //Pagination::set_config($config);
     $data['posts'] = DB::select()->from('posts')->where('user_id', '=', $this->user->id)->and_where('status', self::STATUS_DISP)->and_where('location', $this->param('location'))->order_by('serial_dive_no', 'desc')->as_object()->execute();
     $data['pager'] = Pagination::create_links();
     $this->template->content->content = View::forge('user/log', $data, false);
     return $this->template;
 }
开发者ID:nobuhiko,项目名称:mylogbook,代码行数:9,代码来源:user.php

示例4: array

 function _actionIndex($page = 1)
 {
     $this->data['list'] = $this->_getList($page);
     $this->data['page'] = $page;
     $this->data['total_rows'] = $this->data['list']['total'];
     $param_paging = array('base_url' => URL::Base("materi/index"), 'cur_page' => $page, 'total_rows' => $this->data['list']['total'], 'per_page' => $this->limit, 'first_tag_open' => '<li>', 'first_tag_close' => '</li>', 'last_tag_open' => '<li>', 'last_tag_close' => '</li>', 'cur_tag_open' => '<li><span class="pagination__page--current">', 'cur_tag_close' => '</span></li>', 'next_tag_open' => '<li>', 'next_tag_close' => '</li>', 'prev_tag_open' => '<li>', 'prev_tag_close' => '</li>', 'num_tag_open' => '<li>', 'num_tag_close' => '</li>', 'anchor_class' => 'pagination__page');
     $paging = new Pagination($param_paging);
     $this->data['paging'] = $paging->create_links();
     $this->data['limit'] = $this->limit;
     $this->data['limit_arr'] = $this->limit_arr;
     $this->View($this->viewlist);
 }
开发者ID:arip33,项目名称:simlibrary,代码行数:12,代码来源:Materi.php

示例5: array

 function _actionIndex($page = 1)
 {
     $this->data['header'] = array(array('name' => 'id_member', 'label' => 'ID Member', 'width' => "auto"), array('name' => 'nama', 'label' => 'Nama', 'width' => "auto"), array('name' => 'tgl_lahir', 'label' => 'Tgl Lahir', 'width' => "auto"), array('name' => 'anggota_sejak', 'label' => 'Anggota Sejak', 'width' => "auto"), array('name' => 'tgl_registrasi', 'label' => 'Tgl Registrasi', 'width' => "auto"), array('name' => 'berlaku_sampai', 'label' => 'Berlaku Sampai', 'width' => "auto"), array('name' => 'jenis_kelamin', 'label' => 'Jenis Kelamin', 'width' => "auto"), array('name' => 'alamat', 'label' => 'Alamat', 'width' => "auto"), array('name' => 'kode_pos', 'label' => 'Kode Pos', 'width' => "auto"), array('name' => 'alamat_surat', 'label' => 'Alamat Surat', 'width' => "auto"), array('name' => 'no_hp', 'label' => 'Hp', 'width' => "auto"), array('name' => 'no_identitas', 'label' => 'No. ID', 'width' => "auto"), array('name' => 'catatan', 'label' => 'Catatan', 'width' => "auto"), array('name' => 'email', 'label' => 'Email', 'width' => "auto"), array('name' => 'password', 'label' => 'Password', 'width' => "auto"));
     $this->data['list'] = $this->_getList($page);
     $this->data['page'] = $page;
     $param_paging = array('base_url' => URL::Base("panelbackend/member/index"), 'cur_page' => $page, 'total_rows' => $this->data['list']['total'], 'per_page' => $this->limit);
     $paging = new Pagination($param_paging);
     $this->data['paging'] = $paging->create_links();
     $this->data['limit'] = $this->limit;
     $this->data['limit_arr'] = $this->limit_arr;
     $this->View($this->viewlist);
 }
开发者ID:arip33,项目名称:simlibrary,代码行数:12,代码来源:Member.php

示例6: array

 function _actionIndex($page = 1)
 {
     $this->data['header'] = array(array('name' => 'nama', 'label' => 'Nama', 'width' => "auto"), array('name' => 'id_lokasi', 'label' => 'Lokasi', 'width' => "auto", 'type' => 'list', 'value' => $this->data['lokasiarr']), array('name' => 'jumlah', 'label' => 'Jumlah', 'width' => "auto"));
     $this->data['list'] = $this->_getList($page);
     $this->data['page'] = $page;
     $param_paging = array('base_url' => URL::Base("panelbackend/buku/index"), 'cur_page' => $page, 'total_rows' => $this->data['list']['total'], 'per_page' => $this->limit);
     $paging = new Pagination($param_paging);
     $this->data['paging'] = $paging->create_links();
     $this->data['limit'] = $this->limit;
     $this->data['limit_arr'] = $this->limit_arr;
     $this->View($this->viewlist);
 }
开发者ID:arip33,项目名称:simlibrary,代码行数:12,代码来源:Buku.php

示例7: array

 function _actionIndex($page = 1)
 {
     $this->data['header'] = array(array('name' => 'nama', 'label' => 'Nama', 'width' => "auto"), array('name' => 'isi', 'label' => 'Isi', 'width' => "auto"), array('name' => 'is_approve', 'label' => 'Tampil', 'width' => "100px", 'type' => 'list', 'value' => array('' => '-pilih-', '0' => 'Tidak', '1' => 'Iya')));
     $this->data['list'] = $this->_getList($page);
     $this->data['page'] = $page;
     $param_paging = array('base_url' => URL::Base("panelbackend/testimoni/index"), 'cur_page' => $page, 'total_rows' => $this->data['list']['total'], 'per_page' => $this->limit);
     $paging = new Pagination($param_paging);
     $this->data['paging'] = $paging->create_links();
     $this->data['limit'] = $this->limit;
     $this->data['limit_arr'] = $this->limit_arr;
     $this->View($this->viewlist);
 }
开发者ID:ahmdzakir,项目名称:ketonggo-simlibrary,代码行数:12,代码来源:Testimoni.php

示例8: array

 function _actionIndex($page = 1)
 {
     $this->data['header'] = array(array('name' => 'id_member', 'label' => 'Nama', 'width' => "auto"), array('name' => 'tgl_pinjam', 'label' => 'Tgl. Pinjam', 'type' => 'date'), array('name' => 'tgl_kembali', 'label' => 'Tgl. Kembali', 'type' => 'date'), array('name' => 'jaminan', 'label' => 'Jaminan', 'width' => "auto"), array('name' => 'kode_jaminan', 'label' => 'Kode Jaminan', 'width' => "auto"));
     $this->data['list'] = $this->_getList($page);
     $this->data['page'] = $page;
     $param_paging = array('base_url' => URL::Base("panelbackend/pinjam/index"), 'cur_page' => $page, 'total_rows' => $this->data['list']['total'], 'per_page' => $this->limit);
     $paging = new Pagination($param_paging);
     $this->data['paging'] = $paging->create_links();
     $this->data['limit'] = $this->limit;
     $this->data['limit_arr'] = $this->limit_arr;
     $this->View($this->viewlist);
 }
开发者ID:arip33,项目名称:simlibrary,代码行数:12,代码来源:Pinjam.php

示例9: array

 function _actionIndex($page = 1)
 {
     $this->data['header'] = array(array('name' => 'nama', 'label' => 'Nama', 'width' => "auto"), array('name' => 'telp', 'label' => 'Telp.', 'width' => "auto"), array('name' => 'alamat', 'label' => 'Alamat', 'width' => "auto"));
     $this->data['list'] = $this->_getList($page);
     $this->data['page'] = $page;
     $param_paging = array('base_url' => URL::Base("panelbackend/petugas/index"), 'cur_page' => $page, 'total_rows' => $this->data['list']['total'], 'per_page' => $this->limit);
     $paging = new Pagination($param_paging);
     $this->data['paging'] = $paging->create_links();
     $this->data['limit'] = $this->limit;
     $this->data['limit_arr'] = $this->limit_arr;
     $this->View($this->viewlist);
 }
开发者ID:arip33,项目名称:simlibrary,代码行数:12,代码来源:Petugas.php

示例10: array

 function _actionIndex($halaman, $page = 1)
 {
     $this->_setHalaman($halaman);
     $filter = " halaman = '{$halaman}' ";
     $this->_setFilter($filter);
     $this->data['list'] = $this->_getList($page);
     $this->data['page'] = $page;
     $param_paging = array('base_url' => URL::Base("page/index/{$halaman}"), 'cur_page' => $page, 'total_rows' => $this->data['list']['total'], 'per_page' => $this->limit, 'first_tag_open' => '<li>', 'first_tag_close' => '</li>', 'last_tag_open' => '<li>', 'last_tag_close' => '</li>', 'cur_tag_open' => '<li class="selected"><span>', 'cur_tag_close' => '</span></li>', 'next_tag_open' => '<li>', 'next_tag_close' => '</li>', 'prev_tag_open' => '<li>', 'prev_tag_close' => '</li>', 'num_tag_open' => '<li>', 'num_tag_close' => '</li>');
     $paging = new Pagination($param_paging);
     $this->data['paging'] = $paging->create_links();
     $this->data['limit'] = $this->limit;
     $this->data['limit_arr'] = $this->limit_arr;
     $this->View($this->viewlist);
 }
开发者ID:ahmdzakir,项目名称:ketonggo-simlibrary,代码行数:14,代码来源:Page.php

示例11: array

 function _actionIndex($halaman, $page = 1)
 {
     $this->_setHalaman($halaman);
     $this->data['header'] = array(array('name' => 'nama', 'label' => 'Judul', 'width' => "auto"), array('name' => 'isi', 'label' => 'Isi', 'width' => "auto"));
     $this->_setFilter(" halaman = '{$halaman}' ");
     $this->data['list'] = $this->_getList($page);
     $this->data['page'] = $page;
     $param_paging = array('base_url' => URL::Base("panelbackend/page/index/{$halaman}"), 'cur_page' => $page, 'total_rows' => $this->data['list']['total'], 'per_page' => $this->limit);
     $paging = new Pagination($param_paging);
     $this->data['paging'] = $paging->create_links();
     $this->data['limit'] = $this->limit;
     $this->data['limit_arr'] = $this->limit_arr;
     $this->View($this->viewlist);
 }
开发者ID:ahmdzakir,项目名称:ketonggo-simlibrary,代码行数:14,代码来源:Page.php

示例12: array

 function _actionIndex($page = 1, $jadwal_kategori_id = 0)
 {
     $this->data['header'] = array(array('name' => 'jadwal_kategori_id', 'label' => 'Spesialis', 'width' => "300px", 'type' => 'list', 'value' => $this->data['listkategori']), array('name' => 'nama', 'label' => 'Nama', 'width' => "auto"));
     if ($jadwal_kategori_id) {
         $this->post['act'] = 'list_search';
         $this->post['list_search'] = array('jadwal_kategori_id' => $jadwal_kategori_id);
     }
     $this->data['list'] = $this->_getList($page);
     $this->data['page'] = $page;
     $param_paging = array('base_url' => URL::Base("jadwal/index"), 'cur_page' => $page, 'total_rows' => $this->data['list']['total'], 'per_page' => $this->limit, 'first_tag_open' => '<li>', 'first_tag_close' => '</li>', 'last_tag_open' => '<li>', 'last_tag_close' => '</li>', 'cur_tag_open' => '<li class="selected"><span>', 'cur_tag_close' => '</span></li>', 'next_tag_open' => '<li>', 'next_tag_close' => '</li>', 'prev_tag_open' => '<li>', 'prev_tag_close' => '</li>', 'num_tag_open' => '<li>', 'num_tag_close' => '</li>');
     $paging = new Pagination($param_paging);
     $this->data['paging'] = $paging->create_links();
     $this->data['limit'] = $this->limit;
     $this->data['limit_arr'] = $this->limit_arr;
     $this->View($this->viewlist);
 }
开发者ID:ahmdzakir,项目名称:ketonggo-simlibrary,代码行数:16,代码来源:Jadwal.php

示例13: getdatas


//.........这里部分代码省略.........
     unset($_GET['listmode']);
     //Monatsevents laden
     $limit = 0;
     $events = $this->getEvents($timestampstart, $timestampend, $limit, $category);
     //$events = addCustomFields($mxCalApp, $events);
     $timestampfirstday = xetadodb_mktime(0, 0, 0, $month, 01, $year);
     $limit = 0;
     switch ($listmode) {
         case 'dayevents':
             $timestamp = (int) $_GET['tsday'];
             $d = xetadodb_date("d", $timestamp);
             $m = xetadodb_date("m", $timestamp);
             $y = xetadodb_date("Y", $timestamp);
             $tseventlist = xetadodb_mktime(0, 0, 0, $m, $d, $y);
             $timestampend = $this->xettcal->get_ts_dayend($tseventlist);
             break;
         case 'weekevents':
             $timestamp = (int) $_GET['tsweek'];
             $tseventlist = $this->xettcal->get_ts_weekstart($timestamp);
             $timestampend = $this->xettcal->get_ts_weekend($tseventlist);
             break;
         case 'monthevents':
             $timestamp = (int) $_GET['tsmonth'];
             $d = xetadodb_date("d", $timestamp);
             $m = xetadodb_date("m", $timestamp);
             $y = xetadodb_date("Y", $timestamp);
             $tseventlist = xetadodb_mktime(0, 0, 0, $m, '01', $y);
             $timestampend = $this->xettcal->get_ts_monthend($tseventlist);
             break;
         case 'upcoming':
         default:
             $timestamp = $now;
             $d = xetadodb_date("d", $timestamp);
             $m = xetadodb_date("m", $timestamp);
             $y = xetadodb_date("Y", $timestamp);
             $tseventlist = xetadodb_mktime(0, 0, 0, $m, $d, $y);
             $timestampend = xetadodb_mktime(0, 0, 0, $m, $d, $y + 1);
             $limit = array('limit' => $this->bloxconfig['limit'], 'offset' => $this->bloxconfig['offset']);
             break;
     }
     $timestampstart = strftime('%Y-%m-%d %H:%M:%S', $tseventlist);
     //umwandlung zu mysql-dateformat
     $timestampend = strftime('%Y-%m-%d %H:%M:%S', $timestampend);
     $listevents = $this->getEvents($timestampstart, $timestampend, $limit, $category);
     $numRows = $modx->getPlaceholder('total');
     //Kategorien laden
     $cat_rows = array();
     $c = $modx->newQuery('migxCalendarCategories');
     $c->where(array('published' => 1));
     if ($collection = $modx->getCollection('migxCalendarCategories', $c)) {
         foreach ($collection as $object) {
             $cat_row = $object->toArray();
             $cat_rows[] = $cat_row;
         }
     }
     $cat_row = array();
     $cat_row['id'] = '0';
     $cat_row['name'] = 'Alle';
     $cat_rows[] = $cat_row;
     $categories = array();
     foreach ($cat_rows as $category) {
         $link['category'] = $modx->getOption('id', $category, 0);
         $category['cat_link'] = $this->helpers->smartModxUrl($resource_id, null, $link);
         $current = (int) $modx->getOption('category', $_GET, 0);
         $category['active_class'] = $current == $link['category'] ? 'active' : '';
         $categories[] = $category;
     }
     $cal = $this->xettcal->getMonthCal($year, $month);
     $bloxdatas = $this->xettcal->makeMonthArray($this->bloxconfig, $cal, array(), $events);
     //$bloxdatas['innerrows']['month'][0]['innerrows']['monthevents'] = $events;
     $bloxdatas['innerrows']['eventlist'] = $listevents;
     $bloxdatas['innerrows']['category'] = $categories;
     //echo '<pre>' . print_r($this->bloxconfig, true) . '</pre>';
     //echo '<pre>' . print_r($bloxdatas, true) . '</pre>';
     unset($_GET['tsmonth']);
     unset($_GET['tsweek']);
     unset($_GET['tsday']);
     $link = array();
     $link['tsday'] = time();
     $bloxdatas['link_today'] = $this->helpers->smartModxUrl($resource_id, null, $link);
     $link = array();
     $link['tsweek'] = time();
     $bloxdatas['link_thisweek'] = $this->helpers->smartModxUrl($resource_id, null, $link);
     $link = array();
     $link['tsmonth'] = time();
     $bloxdatas['link_thismonth'] = $this->helpers->smartModxUrl($resource_id, null, $link);
     $link = array();
     $link['listmode'] = 'upcoming';
     $bloxdatas['link_upcoming'] = $this->helpers->smartModxUrl($resource_id, null, $link);
     require_once $this->bloxconfig['absolutepath'] . 'inc/Pagination.php';
     $p = new Pagination(array('per_page' => $this->bloxconfig['limit'], 'num_links' => $this->bloxconfig['numLinks'], 'cur_page' => $this->bloxconfig['page'], 'total_rows' => $numRows, 'page_query_string' => $this->bloxconfig['pageVarKey'], 'use_page_numbers' => true));
     $bloxdatas['pagination'] = $p->create_links();
     //$bloxdatas['innerrows']['row'] = $rows;
     if ($this->bloxconfig['debug']) {
         //echo '<pre>' . print_r($bloxdatas, true) . '</pre>';
         //echo '---------------------------------------';
         //echo '<pre>' . print_r($rows, true) . '</pre>';
     }
     return $bloxdatas;
 }
开发者ID:Piterden,项目名称:modx_testfloor,代码行数:101,代码来源:getdatas.class.php

示例14: renderChunks

 /**
  *		function: renderChunks
  *		-----------------------
  *		description: do the sql query,
  *		call getChunkReplaced() for each row of the result,
  *		and return the modified chunks.
  *		
  */
 function renderChunks()
 {
     global $modx;
     require_once "Pagination.php";
     $query = '';
     $rs = '';
     $output = $this->header;
     $pageStart = $this->getPageStart();
     if ($this->sql != '') {
         $query = str_replace('_eq_', '=', $this->sql);
     } else {
         $fields = implode(',', array_unique($this->fieldNames));
         $query = 'SELECT ' . $fields . ' FROM ' . $this->tableName;
         if ($this->orderby != '') {
             $query .= ' ORDER BY ' . $this->orderby;
         }
     }
     $rs = $modx->db->query($query);
     $numRows = $modx->db->getRecordCount($rs);
     if ($this->perPage > 0) {
         $from = $pageStart - 1;
         $query .= ' LIMIT ' . $from . ', ' . $this->perPage;
     }
     $rs = $modx->db->query($query);
     // echo $query . '<br/>';
     $this->chunk = $modx->getChunk($this->chunkName);
     $i = 0;
     while ($row = $modx->db->getRow($rs)) {
         $output .= $this->getChunkReplaced($row, $i);
         $i++;
     }
     $output .= $this->footer;
     if ($this->perPage > 0) {
         $p = new Pagination(array('per_page' => $this->perPage, 'num_links' => $this->numLinks, 'cur_item' => $pageStart, 'total_rows' => $numRows));
         $output .= '<div class="ldb_pagination">' . $p->create_links() . '</div>';
     }
     return $output;
 }
开发者ID:Bruno17,项目名称:bloX-Xedit,代码行数:46,代码来源:LoopDBChunk.php

示例15: _actionIndex

 public function _actionIndex($page = 1)
 {
     $this->data['header'] = $this->Header();
     $this->data['list'] = $this->_getList($page);
     $this->data['page'] = $page;
     $param_paging = array('base_url' => URL::Base("{$this->page_ctrl}/index"), 'cur_page' => $page, 'total_rows' => $this->data['list']['total'], 'per_page' => $this->limit);
     $paging = new Pagination($param_paging);
     $this->data['paging'] = $paging->create_links();
     $this->data['limit'] = $this->limit;
     $this->data['limit_arr'] = $this->limit_arr;
     $this->View($this->viewlist);
 }
开发者ID:arip33,项目名称:elearning,代码行数:12,代码来源:_adminController.php


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