[Symfony] Custom theme for propel:generate-module

& php, symfony.

Propel generators are very useful tool, they automate creating of most common CRUD modules. However default theme have serial issues. Mostly, html forms are based on tables and list is not a sfPropelPager.

But there is an easy way to make your own theme based on symfony default. You can find it into sf_pear_dir/data/generator/sfPropelModule/default and add/modify whatever you want. To use it in your app just putt it into sf_project_dir/data/geneator/sfPropelModule directory.

Then using symfony console script use “theme” argument:

empathon@aden ~/workspace/example $ symfony propel:generate-module backend author Author --with-show --theme=clean

I have create my own custom theme with forms on divs, pager, flash messege on delete and create/edit. You can download it here.

Udpate: Few errors fixed.

3 Responses to “[Symfony] Custom theme for propel:generate-module”

  1. minaya

    Thank you so much for this example. I didn’t find any other site with documentation to change the default theme and this is exactly what I need. If I could do some enhancement on the theme, I’ll tell you.

  2. Jason

    Many thanks. The documentation says this is possible, but never actually shows examples of how to do it.

  3. Dziamid

    This is what I’ve been looking for. Thanks a lot! Looked through your _form.php template and there’s a minor bug: tag is not rendered (because it is inside the ELSE block, you might want to move it)..

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>