Forums / Developer / Third party PHP classes integration with eZ

Third party PHP classes integration with eZ

Author Message

Ricardo Sanchez

Tuesday 30 October 2007 2:10:12 am

Hi,

I've got a few PHP files containing classes and code that I've using in other web applications. Those classes are used to create objects with atributes (like an Event with dates, places, latitude and longitude coordinates, ...), and to store those atributes in a custom database table.

Also, there are others clases in order to modify, validate and view the content of those objects.

Is any way to reuse those classes in eZ without rewrite it completely? I've reading and in http://www.sitepoint.com/article/phps-killer-app-parts-1-3 explains how to do it, but It seems to be with a 2.x version of eZ.

I would prefer to use those classes instead to setup the classes in the admin zone of an eZ Publish web because I've got to export these functionalities to another PHP system not based in eZ.

Thanks in advance,

Knut Urdalen

Tuesday 30 October 2007 3:50:26 am

The best way to do it is to create modules for all the parts you want to integrate in your custom extension. There you can do whatever you want with PHP and set template variables to use with your custom templates.

Actually the eZ Publish kernel is built on modules. The best way to learn is to read the source (kernel/*).

Some references:
- http://ezpedia.org/wiki/en/ez/developers#eztoc346_6
- http://ezpedia.org/wiki/en/ez/module
- http://ez.no/ezpublish/documentation/development/extensions/module/module_tutorial_part_1
- http://ez.no/ezpublish/documentation/development/extensions/building_an_ez_publish_module