Follow this procedure to install the package:
1. Extract the compressed file
You will find 3 folders in it:
2. Install the admin generator (theme)
This guide starts from a working installation of Symfony 1.4.x. If You don't have already created your project, please refer to Symfony documentation.
Copy the content of the extracted data/ folder into the data/ folder of your Symfony project.
The name of the new admin generator is admin_iml.
The installation of the admin generator is that simple, from now on you will be able to use it in any admin Symfony module of your project.
3. Install DataTables jQuery plugin
Copy the file jquery.dataTables.min.js contained in the web/js/ directory of the package in the js/ folder of your Symfony project.
You can also download the latest version of this plugin from here.
As it requires jQuery to work, copy the file jquery-1.5.2.min.js contained in the web/js/ directory of the package in the js/ folder of your Symfony project if not already included.
Optionally copy the files admin_iml.css and sfadminoverwrite.css contained in the web/css/ directory of the package in the css/ folder of your Symfony project. The first is the default css of the plugin with small modifications and the second is made by me to correct some layout errors.
4. Use the new admin generator
Make your admin generator configuration file (generator.yml) look like this:
The most important things are:
to use the new admin generator theme
to load all data at once
to prevent batch actions. You can enable batch actions, but it will work only on the records displayed at the moment, and not on the entire collection of data.
Don't forget to clean the cache every time you will made changes to the admin generator, and also right now after the first installation.
php symfony cc
5. (Optionally) Customize the plugin settings
By default the plugin is initialized in this way:
- pagination with full numbers
- showing 15 rows
- sorting the table through the first column (index 0) in ascending order
Of course you can completely customize the plugin behavior, and moreover you can make it without modifying the admin generator.
Create a file called listheader.php in the template/ directory of your module. You can give a look to the apps/frontend/module/ folder of the package for a couple of examples.
This is a sample of the function __extenddataTable(oTable)___: