can you not use:
<?php include_component('module', 'sidebar', array('data', $data)) ?>
On 1/19/08 12:47 PM, "Balaji Srinivasan" <[EMAIL PROTECTED]> wrote:
>
> Thanks Lee.
> This is what I mean.
>
> I have a page with a main part and a side bar.
> When the action method is called (say its executeDoStuff() I do the
> following:
>
> public function executeDoStuff() {
> $id = $this->getRequestParameter('id');
> $data = DataPeer::retrieveByPK($id);
> $this->setVar('data', $data);
> return sfView::SUCCESS;
> }
>
> Now the template doStuff.php can use the data. Later when the sidebar
> component gets called I need to be able to access the retrieved data
> above.
>
> public function executeSidebar() {
> $data = $this->getVar('data');
> // do stuff
> return sfView::SUCCESS;
> }
>
> The reason the two things are split as components (instead of just
> partials) is that I need to do some processing on the data before
> rendering the sidebar.
> Any suggestions?
> Thanks
> Balaji
>
> On Jan 19, 2008, at 5:15 AM, Lee Bolding wrote:
>
>>
>> Not sure exactly what you mean, but look in the documentation
>> regarding
>> partials - it sounds like this will solve your problem :)
>>
>> Lee Bolding
>>
>> w: http://www.leesbian.net
>>
>> -----Original Message-----
>> From: [email protected] [mailto:[email protected]
>> ]
>> On Behalf Of Balaji Srinivasan
>> Sent: 19 January 2008 03:38
>> To: [email protected]
>> Subject: [symfony-users] Sharing data between actions and components
>>
>>
>> Hi Everyone
>> I am relatively new to symfony and am trying to figure out how to
>> navigate around components and actions etc.
>>
>> I have a layout that has a main area where the content is and a
>> sidebar where some related information needs to be displayed. I need
>> to be able to share some data between the action and the component. Is
>> there a standard way to do that?
>>
>> Any help would be appreciated
>> Thanks
>> Balaji
>>
>>
>>
>>
>> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---