承接 savvy/filternator-bundle 相关项目开发

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

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

savvy/filternator-bundle

Composer 安装命令:

composer require savvy/filternator-bundle

包简介

Bundle to use knp paginator bundle and lexik form filter bundle

README 文档

README

#Filter-Nator

This bundle is a simple link between the KnpPaginatorBundle and the LexikFormFilterBundle allowing entities to be filtered (Filter) and paginated (Nator).

##Installation

###Step 1

Add the Filter-Nator bundle as a dependency in your composer.json:

{
    require: {
        "savvy/filternator-bundle": "dev-master"
    }
}

###Step 2 Update the dependecies using composer:

$ php composer.phar update

###Step 3 Add the Filter-Nator bundle to the AppKernal.php file:

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            //...
            new Savvy\FilterNatorBundle\SavvyFilterNatorBundle(),

##Usage

The Filter-Nator bundle has one method, filterNate(). This method requires a query builder object, a filter form and a unique string to be used to store the form data in the session. The returned value is the pagination object from the KnpPaginatorBundle:

//Any class with access to the ContainerInterface object
$pagination = $this->container->get("savvy.filter_nator")->filterNate($filterBuilder, $form, 'foo');

###Options

There are two additional arguments that can be given to filterNate() to set the required number of entites to return and the page number to start on:

//Any class with access to the ContainerInterface object
$pagination = $this->container->get("savvy.filter_nator")->filterNate(
    $filterBuilder,
    $form,
    'foo',
    5, /*return 5 entities*/
    1  /*starting from page 1*/
);

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-02-18