uam / datatables-bundle
Datatables jquery plugin packaged as a Symfony bundle
Installs: 30 923
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- symfony/framework-bundle: ^2.8|^3.0
Requires (Dev)
- 5.0.0
- dev-master / 4.0.x-dev
- 4.0.2
- 4.0.1
- 4.0.0
- 3.1.0
- 3.0.27
- 3.0.26
- 3.0.25
- 3.0.24
- 3.0.23
- 3.0.22
- 3.0.21
- 3.0.20
- 3.0.19
- 3.0.18
- 3.0.17
- 3.0.16
- 3.0.15
- 3.0.14
- 3.0.13
- 3.0.12
- 3.0.11
- 3.0.10
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.1.x-dev
- 2.1.11
- 2.1.10
- 2.1.4
- 2.1.3
- 2.1.2
- 2.0.x-dev
- 2.0.2
- 2.0.1
- 1.1.x-dev
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.0.x-dev
- 1.0.1
- 1.0.0
- 0.1.0
- dev-develop
This package is auto-updated.
Last update: 2024-10-29 03:25:49 UTC
README
A symfony 2 bundle that provides a convenient way to include the dataTables jquery plugin in your symfony 2 apps.
This bundle includes release 1.10 of the dataTables plugin. It also includes the plugin's bootstrap-related additions.
Installation
Add the bundle to your project's composer.json
:
{ "require": { "uam/datatables-bundle": "~3.0", ... } }
Run composer install
or composer update
to install the bundle:
$ php composer.phar update uam/datatables-bundle
Enable the bundle in the app's kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new UAM\Bundle\DatatablesBundle\UAMDatatablesBundle(), ); }
If your composer.json does not include the post-install or post-update installAssets
script handler, then run the following command:
$ php app/console assets:install
or
$ php app/console assets:install --symlink
Usage
To learn how to use the dataTables jquery plugin itself, see the plugin's home page at http://www.datatables.net.
To use the bundle itself, simply include the bundle's assets in your templates like you would any other bundle. The dataTables plugin's assets are available under the web/bundles/uamdatatables
directory.
# template.html.twig {% stylesheets filter="cssrewrite" 'bundles/uamdatatables/vendor/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css' 'bundles/uamdatatables/vendor/datatables-plugins/integration/font-awesome/dataTables.fontAwesome.css' 'bundles/uamdatatables/css/table.css' %} <link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen" /> {% endstylesheets %} {% javascripts 'bundles/uamdatatables/vendor/datatables/media/js/jquery.dataTables.min.js' 'bundles/uamdatatables/vendor/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js' %} <script src="{{ asset_url }}"></script> {% endjavascripts %}
If you use assetic, you need to declare the UAMDatatablesBundle in your config file's assetic
section.
What's included
The bundle currently includes the following assets:
- jquery dataTables plugin release 1.10.6
- dataTables/bootstrap integration plugin
- dataTables/font-awesome integration plugin
The bundle also includes a DatatablesEnabledControllerTrait and associated assets to help you design pages that list DB-entities using dataTables.
How it works
The bundle's assets are managed via bower and gulp.
Adding more assets
If you need more dataTables assets than are currently included, follow this procedure:
- Fork the bundle
- Customize the bower configuration file (
Resources/config/bower.json
):- Add the assets you require in the
overrides|datatables-plugins|main
section - Remove assets you do not require from the
overrides
section
- Add the assets you require in the
- Run
gulp
from the bundle'sResources\config
directory
Licence
This bundle is licensed under the MIT license.
The dataTables jquery plugin is licensed under the MIT license.
Copyright
This bundle is copyright United Asian Management Limited.
The dataTables jquery plugin is copyright Allan Jardine (www.sprymedia.co.uk).
All rights reserved by their respective copyright holders.