diff --git a/app/AppKernel.php b/app/AppKernel.php index 724f7f9..93c6130 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -18,6 +18,7 @@ class AppKernel extends Kernel new AppBundle\AppBundle(), new Knp\Bundle\MenuBundle\KnpMenuBundle(), new Oneup\FlysystemBundle\OneupFlysystemBundle(), + new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(), ]; if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { diff --git a/app/config/config.yml b/app/config/config.yml index 4b4bbd4..e91ef20 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -82,6 +82,17 @@ knp_menu: # the renderer to use, list is also available by default default_renderer: twig +knp_paginator: + page_range: 5 # default page range used in pagination control + default_options: + page_name: page # page query parameter name + sort_field_name: sort # sort field query parameter name + sort_direction_name: direction # sort direction query parameter name + distinct: true # ensure distinct results, useful when ORM queries are using GROUP BY statements + template: + pagination: KnpPaginatorBundle:Pagination:sliding.html.twig # sliding pagination controls template + sortable: KnpPaginatorBundle:Pagination:sortable_link.html.twig # sort link template + oneup_flysystem: adapters: ldraw_adapter: diff --git a/composer.json b/composer.json index 4346b66..c482c2f 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,8 @@ "incenteev/composer-parameter-handler": "^2.0", "guzzlehttp/guzzle": "^6.2", "knplabs/knp-menu-bundle": "^2.0", - "oneup/flysystem-bundle": "^1.7" + "oneup/flysystem-bundle": "^1.7", + "knplabs/knp-paginator-bundle": "^2.5" }, "require-dev": { "sensio/generator-bundle": "^3.0", diff --git a/composer.lock b/composer.lock index fccd0a0..58aa1f3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "54b7bfc7ee85ba1c5bb4cd9f7d9cfa60", + "content-hash": "849d1466a083135960cd370040489403", "packages": [ { "name": "doctrine/annotations", @@ -1046,6 +1046,77 @@ ], "time": "2014-01-12T16:20:24+00:00" }, + { + "name": "knplabs/knp-components", + "version": "1.3.4", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/knp-components.git", + "reference": "f98bcc6d348fbe863a224b468e11fb5e91e28f2a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/knp-components/zipball/f98bcc6d348fbe863a224b468e11fb5e91e28f2a", + "reference": "f98bcc6d348fbe863a224b468e11fb5e91e28f2a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "doctrine/mongodb-odm": "~1.0@beta", + "doctrine/orm": "~2.4", + "doctrine/phpcr-odm": "~1.2", + "jackalope/jackalope-doctrine-dbal": "~1.2", + "phpunit/phpunit": "~4.2", + "ruflin/elastica": "~1.0", + "symfony/event-dispatcher": "~2.5" + }, + "suggest": { + "doctrine/common": "to allow usage pagination with Doctrine ArrayCollection", + "doctrine/mongodb-odm": "to allow usage pagination with Doctrine ODM MongoDB", + "doctrine/orm": "to allow usage pagination with Doctrine ORM", + "doctrine/phpcr-odm": "to allow usage pagination with Doctrine ODM PHPCR", + "propel/propel1": "to allow usage pagination with Propel ORM", + "ruflin/Elastica": "to allow usage pagination with ElasticSearch Client", + "solarium/solarium": "to allow usage pagination with Solarium Client" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-0": { + "Knp\\Component": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KnpLabs Team", + "homepage": "http://knplabs.com" + }, + { + "name": "Symfony Community", + "homepage": "http://github.com/KnpLabs/knp-components/contributors" + } + ], + "description": "Knplabs component library", + "homepage": "http://github.com/KnpLabs/knp-components", + "keywords": [ + "components", + "knp", + "knplabs", + "pager", + "paginator" + ], + "time": "2016-12-06T18:10:24+00:00" + }, { "name": "knplabs/knp-menu", "version": "2.2.0", @@ -1169,6 +1240,67 @@ ], "time": "2016-09-22T12:24:40+00:00" }, + { + "name": "knplabs/knp-paginator-bundle", + "version": "2.5.3", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/KnpPaginatorBundle.git", + "reference": "c988761005504007c6c87d6a557641281194a0e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/KnpPaginatorBundle/zipball/c988761005504007c6c87d6a557641281194a0e5", + "reference": "c988761005504007c6c87d6a557641281194a0e5", + "shasum": "" + }, + "require": { + "knplabs/knp-components": "~1.2", + "php": ">=5.3.3", + "symfony/framework-bundle": "~2.3|~3.0", + "twig/twig": "~1.12|~2" + }, + "require-dev": { + "symfony/expression-language": "~2.4|~3.0" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "2.5.x-dev" + } + }, + "autoload": { + "psr-4": { + "Knp\\Bundle\\PaginatorBundle\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KnpLabs Team", + "homepage": "http://knplabs.com" + }, + { + "name": "Symfony2 Community", + "homepage": "http://github.com/KnpLabs/KnpPaginatorBundle/contributors" + } + ], + "description": "Paginator bundle for Symfony2 to automate pagination and simplify sorting and other features", + "homepage": "http://github.com/KnpLabs/KnpPaginatorBundle", + "keywords": [ + "Symfony2", + "bundle", + "knp", + "knplabs", + "pager", + "pagination", + "paginator" + ], + "time": "2016-04-20T11:40:30+00:00" + }, { "name": "league/flysystem", "version": "1.0.32",