This bundle generates code cute you extending SensioGeneratorBundle using KnpPaginatorBundle and Boostrap Templates.
Add following lines to your composer.json
file:
"require": {
...
"mwsimple/crud-generator": "v2.3.9"
}
"require": {
...
"mwsimple/crud-generator": "dev-2.3-bootstrap2"
}
"require": {
...
"mwsimple/crud-generator": "v2.3.3"
}
"require": {
...
"mwsimple/crud-generator": "v2.3.2"
}
Execute:
php composer.phar update "mwsimple/crud-generator"
Add it to the AppKernel.php
class:
// ...
new MWSimple\Bundle\CrudGeneratorBundle\MWSimpleCrudGeneratorBundle(),
new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
You can configure config.yml
default query parameter names and templates
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:twitter_bootstrap_v3_pagination.html.twig # bootstrap 3 sliding pagination controls template
sortable: KnpPaginatorBundle:Pagination:sortable_link.html.twig # sort link template
You can configure config.yml
find Twig Configuration
twig:
...
form:
resources:
- LexikFormFilterBundle:Form:form_div_layout.html.twig
You can configure config.yml
framework:
...
translator: { fallback: %locale% } # uncomment line
app/console assets:install
This bundle extends SensioGeneratorBundle and add a paginator using KnpPaginatorBundle and filter using LexikFormFilterBundle .
Use following command from console:
app/console mwsimple:generate:crud
Gonzalo Alonso - [email protected]
Tito Canteros - [email protected]
.