renderElement takes two parameters
you could try this
$params['user_id'] = $user_id;
echo $this->renderElement('user_box', $params);
and in the element look for it
(hint it will be $user_id ;)
Sma D
On 8/4/06, half_brick <[EMAIL PROTECTED]> wrote:
Hi,
I'm trying to pass some arguments into an element from a view.
Basically, I'm rendering comments in a view and want to pass the userid
of the comment to the element/component so that for every comment the
userinformation and avatar is shown.
Currently im trying to pass in the userid in the renderElement call.
But I can't seem to get it back out in the startup method of the
component.
My code is as follows
in the view I call:
echo $this->renderElement('user_box', $user_id, $params);
and in the userbox I've tried so many different ways to get hold of
that $user_id parameter.
If someone could tell me how to get it, my problems would be solved.
Cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---
- Providing arguments to element from view half_brick
- Re: Providing arguments to element from view Samuel DeVore
- Re: Providing arguments to element from view half_brick
- Re: Providing arguments to element from view Samuel DeVore
- Re: Providing arguments to element from vie... half_brick
- Re: Providing arguments to element fro... half_brick