On Wednesday 29 August 2007 16:05, Frederik Holljen wrote:
> On Wednesday 29 August 2007, Kore Nordmann wrote:
> > 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. :)
>
> It's basically a global variable... but how do you know which global
> variables are available in a template?

Hehe, everytime I reply to one email and get two mails back :-).

1. {use $send} could be passed, be a global variable, or only accessible via a 
function. Technically, there is no difference between a global variable and 
being it a function call: getSendVariables().

2. Having the global $send or a function call getSendVariables() does not make 
it clear which variables are available. Also the checks to see if certain 
variables are given, are omitted; thus result in some less obvious error 
messages.

3. Solution 4: globals, *does* specify which variables are available. ({global 
$a, $b, $c} not {global $send})


Raymond.
-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to