Using objecs instead of arrays [WAS: Deep access of associative array value by dynamic index.]
| From: | Tom | Date: | Fri, 30 Apr 2004 09:50:09 +0000 |
| Subject: | Using objecs instead of arrays [WAS: Deep access of associative array value by dynamic index.] | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11334@lists.php.net to get a copy of this message | ||
Hi Jochem.
Jochem Maas wrote:
regardless of the fact that you solved the problem I thought it might be interesting to point out that using an object might make things a little easier on the eyes/brain.[*Small TomObj Class Snipped*] Yes, this is a very good suggestion. Often when these kinds of arrays get built, looking at using an object is a good idea. And I would most likely agree that the snippet I used to represent my problem could be better tackled with an object. ASIDE: Will {$foo->selection[$foo->selected]} work with Smarty 2.5.0? Either way, due to the 'bigger' picture of the whole project, I will be sticking with arrays in this particular instance. Thanks though! :)