Forums / Developer / fetch records from specific table in templates

fetch records from specific table in templates

Author Message

Dhaval Patel

Friday 14 December 2007 5:03:57 am

hi all

i have created one table.

i want to fetch all the records from that table in templates.

so can u tell me how to execute the query in templated and fetch data from table?

like in php

$result = $db->arrayQuery($query);

i want that type of result in template.

thank you very much for replying.

With Best Regards,

Dhaval Patel
Team Leader - iNETProcess(I) Pvt. LTD.
dhaval.patel@inetprocess.com
Ph No: +91 79 65 12 35 00
http://www.inetprocess.co.in

Laurent BOURREL

Friday 14 December 2007 6:27:12 am

Hi,
I think you will have to use your own template operator... and so, make your request in the php code, not directly in the template.

Gaetano Giunta

Saturday 15 December 2007 5:38:49 am

You can also take a look at the ezpersistentobject class.

If you map your table into a persistent object subclass, then you can use standard functionality tro have all table data retrieved and nicely wrapped in php (template) objects, too, via $array = eZPersistentObject::fetchObjectList( myPersistentObject::definition(), ...)

You can then use that array inside php code in a custom view, or create a custom operator to fetch it.

Principal Consultant International Business
Member of the Community Project Board

Dhaval Patel

Monday 17 December 2007 9:17:27 pm

hi,

thank you very much.

i have created template operator and i got result.

but now i want make one search template.

and serach action in php file.

i made that but i want to send the result from php file to template file.

i have created one topic for this.

please send me reply.

thank you again

With Best Regards,

Dhaval Patel
Team Leader - iNETProcess(I) Pvt. LTD.
dhaval.patel@inetprocess.com
Ph No: +91 79 65 12 35 00
http://www.inetprocess.co.in