承接 evheniy/simple-pagination-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

evheniy/simple-pagination-bundle

最新稳定版本:1.6

Composer 安装命令:

composer require evheniy/simple-pagination-bundle

包简介

The SimplePaginationBundle adds the ability to use simple pagination in your application.

README 文档

README

knpbundles.com

Latest Stable Version Total Downloads Latest Unstable Version License

Scrutinizer Code Quality Build Status

Build Status

This bundle provides the ability to use simple pagination in your Symfony2 application.

Installation

SimplePaginationBundle:

$ composer require evheniy/simple-pagination-bundle "1.*"

Or add to composer.json

"evheniy/simple-pagination-bundle": "1.*"

AppKernel:

    public function registerBundles()
        {
            $bundles = array(
                ...
                new Evheniy\SimplePaginationBundle\SimplePaginationBundle(),
            );
            ...

Controller

$pagination = $this->container->get('pagination');
$pageParameter = 'page';
$page = $request->get($pageParameter, 1);//page number
$size = $request->get('size', 10);//items per page
$range = 10;//navigation links on page 

return $this->render(
            'AppBundle:Default:index.html.twig',
            array(
                ...
                'pagination'  => $pagination->paginate(
                    $request->get('_route'),
                    $resultsCount,
                    $page,
                    $size,
                    $range,
                    $request->query->all(),
                    $pageParameter
                )
            )
        );

Layout for Twitter Bootstrap

{% include "SimplePaginationBundle::pagination.bootstrap.html.twig" %}

Or simple

{% include "SimplePaginationBundle::pagination.html.twig" %}

And styles for example like this

<style>
.pagination {
    text-align: center;
}
.pagination span a {
    display: inline-block;
    padding: 4px 8px;
    margin: 3px;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}
.pagination span a:hover {
    color: #333;
    text-decoration: none;
}
.pagination span a:active {
    outline: thin dotted;
    outline: 5px auto -webkit-focus-ring-color;
    outline-offset: -2px;
}
.pagination span.current {
    display: inline-block;
    padding: 4px 8px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}
</style>

License

This bundle is under the MIT license.

Документация на русском языке

Demo

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-06