定制 abraovic/php-paginator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

abraovic/php-paginator

最新稳定版本:v0.1

Composer 安装命令:

composer require abraovic/php-paginator

包简介

Simple PHP paginator for Symfony2.8+

README 文档

README

Installation

The preferred method of installation is via Packagist and Composer. Run the following command to install the package and add it as a requirement to your project's composer.json:

composer require abraovic/php-paginator

How to use

Add new twig template path to app/config/config.yml

# Twig Configuration
twig:
    ...
    paths:
        '%kernel.root_dir%/../vendor/abraovic/php-paginator/src/template': 'abraovic_paginate'

In your controller:

use abraovic\phpPaginator\Paginate;

class ... {
    function ... {
        return $this->render(
                    'some.html.twig',
                    [
                        ...,
                        'pagination' => Paginate::data(
                            $page, // current page
                            $limit, // max limit per page
                            $total, // total number of items
                            $this->get('router')->generate('_route_name', array(), true) // route link - replace _route_name with proper name
                        )
                    ]
                );
    }
}

In your twig:

{{ include('@abraovic_paginate/_paginate.html.twig') }}

If there is a translation bundle installed you can translate First and Last labels by adding the keys in your app's messages.yaml like this:

First: [first in some other language]
Last: [last in some other language]

Contributing

Contributions are welcome! Please read CONTRIBUTING for details.

Copyright and license

The abraovic/php-paginator library is copyright © Ante Braovic and licensed for use under the MIT License.

统计信息

  • 总下载量: 259
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-10-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固