Forums / Developer / PHP objects and templates

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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