RE: [PEAR-DEV] Package Proposal: HTML_Template_Dummy
| From: | Lukas Smith | Date: | Fri, 18 Jul 2003 21:30:09 +0000 |
| Subject: | RE: [PEAR-DEV] Package Proposal: HTML_Template_Dummy | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-18402@lists.php.net to get a copy of this message | ||
> From: Paul M Jones [mailto:pjones@ciaweb.net]
> Sent: Friday, July 18, 2003 9:57 PM
> Xipe is a compiling engine, and Dummy is not. Xipe compiles the
> template braces {} and other stuff into a target .php file, then
> executes the target file. Dummy templates use "real" <?php ... ?>
tags
> (ugly though they may be) and include()s the template on call, which
> avoids the compiling step entirely (and the compile-change-checks as
> well). This is not so much for reasons of performance (although
> technically Dummy might be a bit faster for it), but for simplicity:
at
> least one less step (and file directory) for the developer to think
> about. And you use "real," direct PHP, not the
> braces-substituted-for-tags indirect PHP.
>
> Xipe has built-in caching, and Dummy does not. I figure, if you want
> to cache stuff, and you're a PEAR devotee, you might be better off
> using PEAR Cache or Cache_Lite. (Proper use of Cache would avoid
> having to parse every Dummy template every time, of course.) (This is
> not to denigrate Xipe's caching in any way; it is well-thought-out and
> well-integrated.)
>
> Xipe is relatively complex (and rightfully so, for what it does), and
> Dummy is relatively simple, yet with much of the power of Xipe (the
> "PHP as template language" thing).
>
> Xipe does a lot of things Dummy does not: config files, pre- and
> post-filters, and so on, that are functional because Xipe is a
> compiling engine. Dummy can have no reply to that, because Dummy uses
> plain PHP files for templates, and does not pre- or post-process them
> in any way.
>
> Dummy is very simple to extend: create your own class as an extension
> of Dummy, add a method called MyMethod, and you can call it from
inside
> your templates using $this->MyMethod() (because the template is
> include()ed on a fetch() or a display() call, $this refers to the
> current Dummy object).
>
> These, then, are what I would call the strengths of
HTML_Template_Dummy
> over HTML_Template_Xipe: Dummy is simple, straightforward, very
easily
> extensible, and it limits its behavior strictly to the parsing of
> display logic and the encapsulation of display methods.
Ok it still sounds to me that Xipe is the place to put your ideas into.
I don't have a problem with the "Lite" and "Full" variant of a package.
So if you can work with Wolfram to make a Xipe_Lite which implements a
subset of the Xipe API I would be all cool with your proposal.
I really like how you are explaining things so I am quite sure that you
are capable of handling this with Wolfram (he might be short on time
however but I cant speak for him).
But let me ask a question:
It sounds like you are skipping the compiling part by doing the things
that Xipe does when compiling manually. So have you considered to simply
write the Xipe compiled templates directly by hand (I am probably not
getting something here, as I am just going by your explanations and not
looking at the code - dunno if I will find the time to do so in the next
few days)?
Anyways all of what you are saying makes me believe you should try to
look at integrating your ideas into Xipe and/or creating a Lite
implementation of the Xipe API.
Otherwise I am still -1
Regards,
Lukas