Date/time selector returning array
| From: | Marcus Bointon | Date: | Fri, 07 May 2004 15:10:52 +0000 |
| Subject: | Date/time selector returning array | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-11373@lists.php.net to get a copy of this message | ||
I guess this is kind of feature request. In the html_select_date and time
functions, it would be really nice to be able to ask for the return values
as an array instead of a series of named vars, e.g. Instead of specifying
"Date_" as a prefix and getting $Date_Year, $Date_Month and $Date_Day back,
specify an array name of Date and get the properties back in PHP as array
$Date['Year'], $Date['Month'] and $Date['Day']. In HTML the selects
would
have generated names like "Date[Year]" etc.
I only recently encountered being able to arrays like this in HTML and it
makes things so much more elegant and easier to handle, especially when
you're dealing with forms that have variable numbers of fields. I can't
think of any good reason not to prefer doing it this way!
Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcus@synchromedia.co.uk | http://www.synchromedia.co.uk