This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » Developer » Filling in a combo box with data from...

Filling in a combo box with data from a custom table

Filling in a combo box with data from a custom table

Thursday 19 January 2012 12:05:15 pm - 1 reply

Hi guys,

thanks to your help, and thanks to Jérôme Vieilledent, I finally managed to solve a couple of problems.

Now I can use ezPersistentObjects and I know how to create a simple extension... but how can I put both things together??

I created an extension for a custom datatype (AddrBookElement). The class/edit template of this datatype must embed a combo-box, and the values of this combo-box have to be grabbed from a custom table in my DB.

My template looks now like this:

{def $cond = array();}
{def $list = eZPersistentObject::fetchObjectList( AreaIncaricoObject::definition(), null, $cond );}

.... some code here ....

    { foreach( $list as $obj )  }

The combo box displays... nothing!!

I'm sure that the class defining my exPersistentObject is OK (I tested it),

I'm also sure that the extension itself works (removing that combo-box off course),

...but I'm quite sure too that mixing php code and template/html code (as I did) is not a good idea!

What's wrong? And off course, what's the solution?

I'm wondering if I should need a module or something similar to let a $list= fetch("mymodule",list, hash()) possibile...

Any suggestion will be appreciated. The client want the product finished soon... I'm a bit worried about that!


Thursday 19 January 2012 1:32:34 pm


You need to define a new template fetch function  which call you php function. For this you need to create a function_definition file where you define your new template operator.

You can find everything you need here :


Modified on Thursday 19 January 2012 1:33:15 pm by Etienne Loth


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from