Re: [SMARTY] define options for html_options in template?

From: Date: Thu, 16 Oct 2003 18:09:47 +0000
Subject: Re: [SMARTY] define options for html_options in template?
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10363@lists.php.net to get a copy of this message
Since those are usually lookups, I define tables for all of them in the database. Then I provide screens to add, edit, and delete them. So the application user controls what goes in the drop downs, not the template designer. It's a bit of a chore, but I save a lot in maintenance down the road. As for displaying them, I do pretty much what you do, except I usually use a {section} loop to display them, rather than using {html_options}. cheers, Travis Ajay Sharma wrote:
Hello, how do you handle forms with a lot of <select> drop downs? Right now when the designer hands me a form with about a dozen different dropdown boxes, I have to take all those and stick them in a dozen PHP arrays, then assign each one to a smarty variable and print it out like: <select name=blah> {html_options options=$blah_options selected=$blah} </select> Then if someone has to change the options it comes back to me because I have them defined in the PHP code. How do you shift that stuff back into the templates? Actually, as I was typing this I think I may have come up with my own solutions using inline php code with {php}{/php}, hmm.... I'm still curious how others handle this though. later, ajay
-- Travis Low <mailto:travis@dawnstar.com> <http://www.dawnstar.com>

« previous php.smarty.general (#10363) next »