Re: Assigning objects to Smarty ?
| From: | Hojtsy Gabor | Date: | Thu, 26 Apr 2001 16:35:01 +0000 |
| Subject: | Re: Assigning objects to Smarty ? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-596@lists.php.net to get a copy of this message | ||
> I had to actually put out a layer of classes on my site and do associative
> arrays instead. I would definitely prefer to pass an array of objects.
You can:
$array = (array) $object;
And then $array would contain the variables from the
$object as an associative array. I think this is what
you need. By using -> you state that it is an object,
but by using . you can use absolutely any data type
(converted to an array :).
Goba
........................................................... . . . . .
http://weblabor.hu/ | http://www.php.net/ | http://www.goba.hu/