Re: [SMARTY] "html_options" for dealing with objects and arrays of objects
| From: | zzd | Date: | Fri, 30 May 2003 18:56:09 +0000 |
| Subject: | Re: [SMARTY] "html_options" for dealing with objects and arrays of objects | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9614@lists.php.net to get a copy of this message | ||
> Some example code
> -----------------------------
> A simple object passed in as an option:
> {html_options_ob options=$object}
I was asked why I needed this and how I would use it.
Mostly, I use it when I return each row from an sql query as an object
and not as an associative array. I then place all the rows into an
array. This allows me to pass the array of row objects to the html
select function to create a select list by letting the function know
the name of the property I want to use as the option value and the name
of the property that contains the option label.
I hope this may be of help to others on the list,
Z