glavweb / datagrid-bundle
GLAVWEB DatagridBundle
Installs: 4 379
Dependents: 2
Suggesters: 0
Security: 0
Stars: 11
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7.2.5
- ext-json: *
- doctrine/doctrine-bundle: ^2.0
- doctrine/orm: ^2.3
- glavweb/data-schema-bundle: ^2.0
- symfony/config: ^4.0|^5.0|^6.0
- symfony/dependency-injection: ^4.0|^5.0|^6.0
- symfony/yaml: ^4.0|^5.0|^6.0
Requires (Dev)
- phpunit/phpunit: ^6.4
- symfony/phpunit-bridge: ^3.3
- dev-master
- v3.1.1
- v3.1.0
- v3.0.0
- v2.4.0
- v2.3.0
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.0
- v1.11.1
- v1.11.0
- 1.10.x-dev
- v1.10.6
- v1.10.5
- v1.10.4
- v1.10.3
- v1.10.2
- v1.10.1
- v1.10.0
- v1.9.7
- v1.9.6
- v1.9.5
- v1.9.4
- v1.9.3
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.1
- v1.8
- v1.7
- v1.6
- v1.5.2
- v1.5.1
- v1.5
- v1.4
- v1.3
- v1.2
- v1.1.2
- v1.1.1
- v1.1
- 1.0
- 0.2
- 0.1.x-dev
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
This package is auto-updated.
Last update: 2024-10-28 11:35:32 UTC
README
Get the bundle using composer
Add GlavwebDatagridBundle by running this command from the terminal at the root of your Symfony project:
php composer.phar require glavweb/datagrid-bundle
Enable the bundle
To start using the bundle, register the bundle in your application's kernel class:
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Glavweb\DatagridBundle\GlavwebDatagridBundle(), // ... ); }
Configure the bundle
This bundle was designed to just work out of the box. The only thing you have to configure in order to get this bundle up and running is a mapping.
Basic Usage
Define data schema:
# app/config/data_schema/article.schema.yml
schema:
class: AppBundle\Entity\Article
properties:
id:
name:
slug:
body:
Define scope:
# app/config/scopes/article/short.yml
scope:
name:
Usage in a controller:
$datagridBuilder = $this->get('glavweb_datagrid.doctrine_datagrid_builder')
->setEntityClassName('AppBundle\Entity\Article')
->setAlias('t')
->setDataSchema('article.schema.yml', 'article/short.yml')
->setFirstResult(0)
->setMaxResults(2)
->setOrderings(['name' => 'ASC'])
;
// Define filters
$datagridBuilder
->addFilter('name')
;
$datagrid = $this->datagridBuilder->build(['name' => 'Article 1']);
$list = $datagrid->getList();