Forums / Developer / PHP objects and templates

PHP objects and templates

Author Message

Jacques Feix

Friday 30 March 2007 1:27:06 am

Hi everybody,

I have my own class php.
When I use an object of this class in a template, I have to convert it as an array to use for example {$myObject.id}
If I don't convert it, it doesn't work.

Is there a specific way to do it with a class of the kernel.
To do it manually is very slow ...

BR, Jacques

Kristof Coomans

Friday 30 March 2007 1:49:46 am

Hi Jacques

You'll have to implement the functions hasAttribute(), attributes() and attribute().

For an example, take a look at lib/ezlocale/classes/ezdate.php

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Jacques Feix

Friday 30 March 2007 2:30:56 am

perfect, thank you Kristof