gforge-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gforge-devel] HTML Interface


From: Roland Mas
Subject: Re: [Gforge-devel] HTML Interface
Date: Wed, 22 Oct 2003 19:47:12 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Tim Perdue, 2003-10-22 11:20:03 -0500 :

> Tom Copeland wrote:

[...]

>> Is there a particular PHP templating system that people like?  I'm
>> not much of a PHPer, so whatever you more experienced guys
>> recommend is fine with me.
>
> PHP is a templating language, there's no need for another one on top.

I half-agree with both of you.  On the one hand, it's true you can do
lots in PHP without another templating system, as I hope we've
demonstrated so far with Gforge :-) On the other hand, there's still
HTML code where it doesn't belong (like in the *.tab files, for
instance).  Also PHP code in themes, which I feel awkward about,
because it means any fix in the code must be ported to all the themes
using that code.

  I'm not a strong proponent of the use of a templating system
(although I'd be pleased if that were to happen).  If that happens,
though, my favourite system would be PHP-HTML::Template [1] or
something very similar.  It's an implementation for PHP of the
HTML::Template Perl module, which I used with great pleasure at work.
It's both clean (no HTML in the code, no PHP in the template) and
powerful (it provides ifs, (nested) loops with special variables like
first and last, includes, and of course variable substitution).  I
especially like the fact that there is a clean "API": the code
provides a known set of data to the template, and the template then
displays it however its designer wants.  I know for a fact that I'd
have a new theme available already if the designer didn't have to
understand the concept of a derived class.

  Though there is some jump between straight PHP and total separation
of code and layout, I don't think there's much point in stopping
in-between, since we're already there (with the HTML layout being
mostly factored into the Layout class and its derived Theme classes).

  In other words: I don't want it to happen just for the sake of it,
and in any case if that happens I don't want a half-baked attempt.
This will need serious thinking to implement, it's not just a matter
of cut-and-pasting stuff around.

[1] http://phphtmltemplate.sourceforge.net/

Roland.
-- 
Roland Mas

With the arrest of Dimitry Sklyarov it has become apparent that it is not
safe for non US software engineers to visit the United States. - Alan Cox




reply via email to

[Prev in Thread] Current Thread [Next in Thread]