国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

??
CodeIgniter分頁類pagination使用方法示例,codeigniter示例
您可能感興趣的文章:
? ??? ?? PHP ???? CodeIgniter分頁類pagination使用方法示例,codeigniter示例_PHP教程

CodeIgniter分頁類pagination使用方法示例,codeigniter示例_PHP教程

Jul 12, 2016 am 08:55 AM
codeigniter pagination

CodeIgniter分頁類pagination使用方法示例,codeigniter示例

本文實例講述了CodeIgniter分頁類pagination使用方法。分享給大家供大家參考,具體如下:

controller控制器(application/controller/page.php文件):

public function index()
{
    $this->load->model ( 'home_model' , '' , TRUE);
    $config= array();
    $config['per_page'] = $this->per_page; //每頁顯示的數(shù)據(jù)數(shù)
    $current_page    = intval($this->input->get_post('per_page',true)); //獲取當(dāng)前分頁頁碼數(shù)
    //page還原
    if(0 == $current_page)
    {
      $current_page = 1;
    }
    $offset = ($current_page - 1 ) * $config['per_page']; //設(shè)置偏移量 限定 數(shù)據(jù)查詢 起始位置(從 $offset 條開始)
    $result = $this->home_model->index($offset,$config['per_page'],$order='id desc');
    $config['base_url']      = $this->config->item('base_url').'admin/home/index?';
    $config['first_link']     = $this->first_link;//首頁
    $config['prev_link']     = $this->prev_link;//上一頁
    $config['next_link']     = $this->next_link;//下一頁
    $config['last_link']     = $this->last_link;//尾頁
    $config['total_rows']     = $result['total'];//總條數(shù)
    $config['num_links'] = 3;//頁碼連接數(shù)
    $config['use_page_numbers']  = TRUE;
    $config['page_query_string'] = TRUE;
    $this->load->library('pagination');//加載ci pagination類
    $this->pagination->initialize($config);
    $result = array(
        'list' => $result['list'],
        'total'  => $result['total'],
        'current_page' => $current_page,
        'per_page' => $config['per_page'],
        'page'  => $this->pagination->create_links(),
    );
    $this->load->view ( 'admin/home' , $result );
}

model模型(application/model/home_model.php文件):

public function index($offset,$num,$order='id desc')
{
    $query = $this->db->query( "SELECT Name_cn,Mall_type,create_time FROM smzdm_mall WHERE Is_deleted = 0 order by {$order} limit {$offset},{$num}");
    return array(
        'total' => $this->db->count_all('smzdm_mall',array('Is_deleted'=>'0')),
        'list' => $query->result(),
    );
}

更多關(guān)于CodeIgniter相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《codeigniter入門教程》、《CI(CodeIgniter)框架進(jìn)階教程》、《php日期與時間用法總結(jié)》、《php面向?qū)ο蟪绦蛟O(shè)計入門教程》、《php字符串(string)用法總結(jié)》、《php+mysql數(shù)據(jù)庫操作入門教程》及《php常見數(shù)據(jù)庫操作技巧匯總》

希望本文所述對大家基于CodeIgniter框架的PHP程序設(shè)計有所幫助。

您可能感興趣的文章:

  • CodeIgniter使用smtp服務(wù)發(fā)送html郵件的方法
  • codeigniter發(fā)送郵件并打印調(diào)試信息的方法
  • Codeigniter發(fā)送郵件的方法
  • Codeigniter實現(xiàn)發(fā)送帶附件的郵件
  • CodeIgniter輔助之第三方類庫third_party用法分析
  • CodeIgniter擴展核心類實例詳解
  • CI(Codeigniter)的Setting增強配置類實例
  • php實現(xiàn)仿寫CodeIgniter的購物車類
  • Codeigniter的dom類用法實例
  • Codeigniter購物車類不能添加中文的解決方法
  • CodeIgniter基于Email類發(fā)郵件的方法

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1117097.htmlTechArticleCodeIgniter分頁類pagination使用方法示例,codeigniter示例 本文實例講述了CodeIgniter分頁類pagination使用方法。分享給大家供大家參考,具體如下:...
? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???
CodeIgniter?? ??? ?? ????? ???? ?? CodeIgniter?? ??? ?? ????? ???? ?? Jul 29, 2023 am 10:53 AM

CodeIgniter?? ??? ?? ????? ???? ?? ??: ?? ? ???? ????? ???????? ??? ??? ???. ??? ????? ???? ??? ?? ?? ?? ?? ??? ???? ? ??? ? ????. ?? ???? PHP ?????? CodeIgniter? ???? ??? ?????. ? ???? CodeIgniter?? ??? ?? ????? ???? ??? ???? ??? ?? ??? ?????. ???? ??: ????? ??? ?????.

CodeIgniter ????: ?????? ??? ? ??? ??? ??? CodeIgniter ????: ?????? ??? ? ??? ??? ??? Jul 28, 2023 pm 06:51 PM

CodeIgniter ????: ?????? ??? ? ??? ??? ??? ??: ? ??????? ???? ?? ??? ?? ???? ?? ???? ?????? ??? ???? ????? ?? ?? ????? ?? ??? ???? ???? ???. CodeIgniter(CI)? ?? ??? ??? ???? ?? PHP ?? ??????? ? ? ??? ???????. ????? ??? ????? ???? ??? ???? ??? ?????. ? ????? ?? ??? ?????.

CodeIgniter ??????? ?????? ?? ??(Query Builder)? ???? ?? CodeIgniter ??????? ?????? ?? ??(Query Builder)? ???? ?? Jul 28, 2023 pm 11:13 PM

CodeIgniter ??????? ?????? ?? ??(QueryBuilder)? ???? ?? ??: CodeIgniter? ? ?????? ???? ???? ???? ?? ?? ??? ??? ?????? ???? ?? PHP ????????. ?? ???? ?? ? ??? ?????? ?? ?? ???? ???? ???? ??? ??? ???? ?????? ?? ??(QueryBuilder)???. ?? ???? Co ???? ???????.

PHP ??: CodeIgniter? ???? MVC ?? ? RESTful API ?? PHP ??: CodeIgniter? ???? MVC ?? ? RESTful API ?? Jun 16, 2023 am 08:09 AM

? ??????? ?? ???? ?? ??????? ?? ??? ????? ???? ?? ?????. ??? RESTful API? ? ???????? ?? ???? ??? ???? RESTful API? ???? ???? ??? ???? ?? ?????. ?? ???? CodeIgniter ?????? ???? MVC ??? RESTful API? ???? ??? ?? ?????. MVC ?? MVC ??(Model-Vie

PHP ?????? CodeIgniter? ???? ??? ?? ??????? ???? ??? ?????? ???? ?????. PHP ?????? CodeIgniter? ???? ??? ?? ??????? ???? ??? ?????? ???? ?????. Jun 27, 2023 pm 02:49 PM

??? ???? ???? ???? ???? ?? ? ????? ????????. ?? ???? ??? ??? ???? ??? ??? ????? ??? ? ?? ??? ?????? ??? ???? ?????? ???? ?????. ?? ???? ? ????? PHP ????? CodeIgniter? ???? ??? ?? ??????? ???? ??? ?????. CodeIgniter ????? ?? CodeIgniter? ???? ??? ??? ? ??? ??? ??? ??? ?????? ???? ?? PHP ????????.

PHP?? CodeIgniter5 ?????? ???? ??? ?????? PHP?? CodeIgniter5 ?????? ???? ??? ?????? Jun 01, 2023 am 11:21 AM

CodeIgniter? MVC ????? ???? ??? ??? ???? ???? ??? ????? ?? PHP ????????. CodeIgniter5? ?????? ?? ???? ?? ??? ??? ?? ??? ?????. ? ????? CodeIgniter5 ?????? ???? ??? ? ??????? ???? ??? ?????. 1??: CodeIgniter5 ?? CodeIgniter5 ???? ? ??? ?? ?????. ?? ??? ?????. ?? ??? ???????.

CodeIgniter ????: ??? ?? ??? ? ???? ?? ?? CodeIgniter ????: ??? ?? ??? ? ???? ?? ?? Aug 01, 2023 pm 03:01 PM

CodeIgniter ????: ??? ?? ??? ? ???? ?? ?? ??: ?? ??? ? ????? ? ?????? ?? ?? ?? ???? ?????. ??? ???? ??? ?? ??? ? ????? ????? ?? ?? ??? ??? ??? ????. CodeIgniter? ???? ???? ???? ? ??????? ??? ? ??? ???? ??? ??? ?????? ???? ?? ?? PHP ????????. ? ????? CodeIgniter ????? ???? ?? ??? ???? ??? ?????.

PHP ?? ?????: CodeIgniter ???? ???? PHP ?? ?????: CodeIgniter ???? ???? Jun 18, 2023 pm 10:43 PM

???? ? ?? ??? ??? ??? ??? ??????? ???? ???? ?? PHP ??? ?? ? ?? ???? ?????. ??? ???? ???? ???? ???? ???? ????. ? ? CodeIgniter? PHP ?? ???? ??? ????? ? ??? ?? ?????? ? ??? ?? ????. ? ???? CodeIgniter ?????? ?? ?? ??? ???? ???? ?? ?? ???? ?????. 1. CodeIgniter ?????? ?????? ??Ig

See all articles