[dev] Re: [cvs] commit: horde/docs CHANGES framework/Template Template.php

Jan Schneider jan at horde.org
Mon Mar 21 00:46:46 PST 2005


Zitat von Jason Felice <jfelice at cronosys.com>:

> eraserhd    2005-03-19 11:13:22 PST
>
>  Modified files:
>    docs                 CHANGES
>    Template             Template.php
>  Log:
>  * Allow Horde templates to include application blocks.

I have very strong objections against this patch for two reasons:

1) Performance. There are a lot of template engines available, and quite a
few with more features, a nicer syntax, whatever. We chose this template
engine because it is fast, even without compiling templates. It is fast
because it only uses PHP's string functions to parse and manipulate
templates. You completely break this architecture using regexps, making the
templates much slower as soon as you use the new feature, that means in
*all* giapeto pages.

2) Abstraction. Until now, the template code was completely independent from
Horde, making it interesting for usage outside of Horde too, e.g. when
installed through Horde's PEAR server. Now we have a tight integration with
internal Horde features, even if optional.

What do you actually want to achieve? Global blocks on each giapeto page?
This could be done much simpler and without even changing the template
code. Add some logic to giapeto to define global blocks for each page, or
even only for selected pages. Define a naming standard for tags that
contain these blocks' contents and start using them in the templates. You
could use simple tags like: <tag:block1 /> or <tag:block.1 />, have all the
logic only  executed when and where necessary (in giapeto) and don't loose
any performance in the general template code.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/


More information about the dev mailing list