That's pretty slick actually..  I never really thought about extending
the compiler to accept some sort of native array parameter..

I'm a broken record on this, but I would have to extend this to support
nested arrays like:

{helper html->select('Model/field', Array('tabindex' => 1, 'options' =>
Array(0 => 'No', 1 => 'Yes'), 'class' => 'selector' ))}

It's not my fault I like run-time multi-dimensional data structures..
:-)   I just find them clean and easy to understand for template
designers..

On Nov 3, 9:29 am, "René" <[EMAIL PROTECTED]> wrote:
> I'm using Smarty for a while now and got around the array issue by this
> compiler helper:
>
> function smarty_compiler_helper($tag_attrs, &$compiler)
> {
>         $args = explode('->', $tag_attrs);
>         $arg0 = $args[0];
>         unset($args[0]);
>         $arg1 = implode('->', $args);
>         $arg1 = preg_replace('/\$(\w+)/', '$this->_tpl_vars[\'\1\']', $arg1);
>         return('echo $this->_tpl_vars[\'' . $arg0 . '\']->' . $arg1 .';');
>
> }With this SmartyPlugin you can use CakePHP helpers like this:
> {helper html->input('Model/field', Array('tabindex' => 1))}
>
> I know this is neither perfect nor clean, but it does the job.
> 
> Greetings,
> René


--~--~---------~--~----~------------~-------~--~----~
 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