Author Topic

Patrick ALLAERT

Friday 19 August 2005 1:10:25 am

Comment43862

I don't think that creating a business logic (or API) behind classes is a <i>specific need</i>...
I think that for now they are still no <b>best practicies</b> for doing this! Of course when your are creating 3 -> 10 custom classes you may always use fetch's functions. But when you reach more than 60 classes, you just can't!

Maybe this approach may be used:
Creating a set of templates that do some <b>core business logic</b> and other templates for the presentation.

Example:

{include uri='api/company/getProducts.tpl'
         company_id=125
}
{* Looping through results *}
{section loop=$results}
  ...
{/section}

This way I don't worry if products and companies are linked with <b>object relations</b> or <b>parent/child relations</b>!

IMHO, this addresses the most disadvantage of eZ templates, business logic is far to often in the template!

Patrick ALLAERT
http://www.dixite.com/
http://users.pandora.be/patrick_allaert/