Code snippets for symfony 1.x
This will allow you to use multiple themes for symfony, each with it's own templates and stylesheets.
Grab the code at GitHub: https://github.com/acetous/Symfony-Themed
The templates have to be stored in
sf_root_dir/themes/application/themename/module. A theme named
default has to be present. Layouts have to be placed in
sf_root_dir/themes/default/frontend/layout.phpis the new place for your layout
sf_root_dir/themes/default/frontend/post/indexSuccess.phpis the new place for the success-template when calling the index-action on the post-module
Create stylesheets for your theme. You'll need to create one for each application.
Please include this stylesheets in your themes root directory. They need to be copied into the
All themes (except
default) will load the default-templates if a custom one is not found. This way you just need to create the template files you want to alter.
Apart from that the default-stylesheet will be included if a custom one cannot be found.
libdirectory (the task to
lib/taskand filter to
filters.yml. Add one filter for the themes logic: <pre>rendering: ~ security: ~ themes: class: ThemedFilter cache: ~ execution: ~ </pre>
Just run the
./symfony themed:setup task to setup all themes or
./symfony themed:setup name to setup a specific theme.