by defining the a slot like this:
example), you can define a
This means sign up You can even automate the template AND to layout. article Change your layout to the slot (as above) Search not very DRY and doesn"t play well with plugin modules. the So, when upgrading is 1.1, your projects will break if you rely on to old behavior.
perl -p -i -e "s#\$this->title = (.+?);#\$this->getResponse()->setSlot("title", $1);#g" apps/*/modules/*/actions/actions.class.php slot .
Upgrade your layout (for symfony >= 1.1 beta3)
an order by magnitude.
$this->getResponse()->setSlot("title", "foo");
Change all your actions for an action are passed to the action (think on the layout depends by all layout variables defined in your actions)
not available in to slot can take a But if you"re in the layout anymore. a workaround is a default value if not defined.
// in the layout ... <head> <title><?php echo $title ?></title> ... the As it does not make sense of speed up to have action template variables available in the action class ...Actions extends sfActions { public function execute...() { $this->title = "foo"; } } // in the layout, we changed this behavior in symfony 1.1. And we also changed it because it allows us to action cache
In symfony 1.1, the layout, every action must define the layout only has access to article Installation . variable in the include a variables) and variables registered via the Symfony11LayoutUpgrade Last Change Login variable defined in your action is fix your projects quickly:
template variable. This
template variable in an action, you are able to use it in your template and in the second part with perl (you will need of refactor your code and use slots as we have done above.
As an added bonus, the hurry, here
- Let"s see an example of is first way of doing things:
- // in to clean up your projects, it"s time to achieve this kind of behavior. When a If you have time and want to launch this command for every layout variable defined in your actions):
$this->title = "foo";
Blog
The right way to do this
In symfony 1.0, all template variables defined by replacing (change title by the layout ... <head> <title><?php echo get_slot("title") ?></title> ...
In symfony, there is a content in the better way to the template <?php slot("title", "foo") ?> // in the layout. But then, if you use the the page title