Developers

License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Additional features to the standard symfony Doctrine admin generator

Sorting On A Virtual Column

The new theme provides an easy way to make virtual columns sortable in the list view. Just declare the corresponding fields with is_sortable to true, and the generated module will look for an orderByXXX() method in the generated query. For instance, to allow a book list to be sortable on the author name:

The generator will execute BookTable::orderByAuthorLastName() instead of BookTable::orderByAuthor() in that case.

And there you have it. Now it's possible to sort on any column, be that a virtual column or a partial. What you have to figure out for yourself is, especially for partials that display multiple columns, the sort column and the direction, so the sorting is meaningful for the user.

Customizable titles

With the standard admin generator theme it's tedious to style the titles (list, new and edit) because they are hard-coded like this:

<h1>[List, New, Edit] Title</h1>

To mitigate this I wrapped this up in the module_header slot. All you need to do is add a partial "_module_header.php" with the following content:

<h1 class="whatever"><?php echo get_slot('module_header') ?></h1>

And include that partial in your layout like so:

<?php include_partial('module_or_global/module_header')?>

Unfortunately, you'll need to do this even if you don't want to add CSS classes or other things to your headers but I think the advantages far outweigh the disadvantages. :)

I also recommend you install the tsTitlePlugin as it will make html <title> cascading possible like so: "AdminModule > Object".

ahAdminGeneratorThemesPluginAdmin: more additional features!

This theme is not for the faint of heart. It needs the plugins ahToolkitPlugin and sfDoctrineGuardPlugin to work and you'll need to add a method to your myUser.class.php.

Those will now be used in the view titles (if you don't change the default title in the list, new, or edit sections in the generator.yml).

Now, here comes another thing you'll need to do (you'll hate me for this, I think): you'll need to provide a quite extensive i18n file to go with this because the singular and plural form is also used to provide much better flash messages. Take a look into the messages.de.xml.sample file that comes with the plugin. All in all you'll need to provide at least 10 translations per module.

Phew, I might have forgotten something. But you can contact me, see the end of this README. :)

Configurable show view

Activate the show view generation in the generator.yml:

generator:
class: sfDoctrineGenerator
param:
...
with_show: true
...

And configure it like so:

# in generator.yml
show:
display: [...]

Different form classes for the new and edit screens

This should be pretty self-explanatory:

# in generator.yml
new:
class: NewBookForm
edit:
class: EditBookForm

Questions, bugs, feature requests?

I can be reached via e-mail: info@asapdesign.de

If you find bugs, have questions and/or feature requests, you can post to the symfony-user mailing list, of which I am an avid follower. :)