Re: html_options

messju mohr <[email protected]> Mon, 26 Feb 2007 15:08:24 +0100
Newsgroups gmane.comp.php.smarty.devel
Message-ID <[email protected]>
On Mon, Feb 26, 2007 at 02:53:20PM +0100, Danilo Buerger wrote:
> 
> >It's the responsobility of the editor who inserts the {html_options}
> >into the template to declare it as multiple or not.
> >
> 
> >
> >the fact if an option list is single or multiple is most times rather
> >static, but the list of actually selected values is highly dynamic.
> >
> 
> I can understand your point about the multiple part although i dont 
> agree. However i dont see why you are going against dropping the 
> array_map('strval'....) (which is unneccessary anyway) to make the 
> plugin work better.

the strval() is necessary to distinguish between "" and 0, like here:

$smarty->assign('options', array('' => 'Please Choose',
                                 0 => 0,
                                 1 => 1,
                                 2 => 2));

$smarty->assign('selected', 0);

...

{html_options name=foo options=$options selected=$selected}




 
> -- 
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php