On 12/3/07, eax <[EMAIL PROTECTED]> wrote:
> I would like to initialize a variable in my controller, and use it in
> components (I don't speak of sessions variables).
You can pass it through the parameters array:
<?php include_component('foo', 'bar', array('myvar' => $myvar)) ?>
Or use the parameter holder of the request object instance. In action:
$this->getRequest()->setParameter('myvar', 'blah');
In component:
$sf_params->get('myvar');
Or if you have enabled output escaping, which is a good idea:
<?php echo $sf_params->getRaw('myvar') ?>
HTH
++
--
Nicolas Perriault http://www.clever-age.com
Clever Age - conseil en architecture technique
GSM: +33 6 60 92 08 67 Tél: +33 1 53 34 66 10
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---