On Wed, 2007-08-29 at 13:50 +0200, Raymond Bosman wrote:
> > 1) Use Structs / Objects
> >
> > You may combine lots of information in some structs or objects
> > representing logical objects in your application, and pass nothing more
> > but them, like a $request-Struct containing all request information.
> >
> > You are probably already dooing this, but the logical seperations still
> > result in too many variables?
>
> Something like?:
>
> {use $send}
> {$send->a}
> {$send->b}
>
> And $send is a default object send to each Template?
Hmm, nice idea. :)
I just thought about sending it using the usual (implemented) mechanism:
{include 'sub_template.ezt' send $sendObject}
But defining a default set of variables which will be sent to each
template, no matter where it will be included is also something that
could work.
>
> > 2) Use custom template functions
> >
> > For most data an application needs to populate to its templates we
> > probably could just use custom template functions, which give access to
> > certain scopes of data.
>
> Something like?:
>
> {var $send = sendVariables()}
> {$send->a}
> {$send->b}
Yes, exactly. Or just:
{var $foo = ezpGetImportantStuff( 'foo' )}
I am dooing this for example for globally defined metadata directly
mapping to a ezcConfiguration::getSetting() in one of my projects. (Of
course with some caching in place)
--
Mit freundlichen Grüßen / Med vennlig hilsen
Kore Nordmann (GPG: 0xDDC70BBB)
eZ Components Developer
eZ systems Headquaters
tel +49 (0) 231-9742-7750 | fax +49 (0) 231-9742-7751
[EMAIL PROTECTED] | eZ systems | ez.no
signature.asc
Description: This is a digitally signed message part
-- Components mailing list [email protected] http://lists.ez.no/mailman/listinfo/components
