2017 © Pedro Peláez
 

library tp5-pages

This is a Page class library based on the ThinkPHP5 framework

image

zhujinkui/tp5-pages

This is a Page class library based on the ThinkPHP5 framework

  • Friday, March 2, 2018
  • by zhujinkui
  • Repository
  • 0 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

tp5-pages

这是一个基于ThinkPHP5框架的Page类库, (*1)

案例展示

基于ThinkPHP5开发呈现分页的效果
Image text, (*2)

安装

composer require zhujinkui/tp5-pages, (*3)

控制器层代码举例使用

建立Member控制器作为会员模块, (*4)

<?php
namespace app\index\controller;
use think\Controller;

class Member extends Controller
{
    public function index()
    {
        //$data通过select()查询未分页的数据,不能是已经分页的对象
        $data = db('Member')->select();

        //参数一:$data未分页的数据,参数二:每页显示的记录数
        $p = new \think\Page($data,2);
        //把分页后的对象$p渲染到模板
        $this->assign([
            'p' => $p,
        ]);

        return $this->fetch();
    }
}

视图层代码举例使用

分页html模板输出 默认已经载入h-ui框架css样式,否则需要重写css样式, (*5)

{$p->render}

The Versions

02/03 2018

dev-master

9999999-dev

This is a Page class library based on the ThinkPHP5 framework

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

by Avatar zhujinkui

02/03 2018

dev-developer

dev-developer

This is a Page class library based on the ThinkPHP5 framework

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

by Avatar zhujinkui

02/03 2018

V1.0

1.0.0.0

This is a Page class library based on the ThinkPHP5 framework

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

by Avatar zhujinkui