one of my favorite php functions these days is http://php.net/compact

On 4/21/07, Gonzalo Servat <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> Say I have:
>
> $this->renderElement('element', array('arg1' => 'val1', 'arg2' => 'val2'));
>
> Once inside element.thtml , how could I render another element and pass
> whatever arguments were passed onto the main element? (ie. arg1, arg2 in
> this case)
>
> I thought of a (untested) workaround, but, it's not very nice. I thought I
> could do something like:
>
> $this->renderElement('element', array('args' => array( 'arg1' => 'val1',
> 'arg2' => 'val2')));
> foreach($args as $key => $val)
> {
> ${$key} = $val;
> }
>
> Inside element.thtml:
>
> $this->renderElement('element2', array($args));
>
> ... but it's too hack-ish. Any other suggestions?
>
> Thanks in advance.
>
> Regards,
> Gonzalo
>
>  >
>


-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to