Re: Package Proposal: HTML_Template_Dummy

From: Date: Sat, 19 Jul 2003 02:42:34 +0000
Subject: Re: Package Proposal: HTML_Template_Dummy
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-18411@lists.php.net to get a copy of this message
Hi, Yavor,
I don't see the use of this class, it is too short to be usefull, anyone needing such functionality could come up with it in a matter of minutes.
True enough ... but part of the point is not the functionality itself, but the mindset (the method, if you will) that leads to using this kind of class. Most of us want to separate business logic from display logic. Most of the time, we start with a token-replacement solution, and that leads to a block-and-looping solution, and that leads to a conditionals/cases/structures solution, and pretty soon you've got Xipe and Smarty and all the rest with configs and plugins and modifiers and the whole show. This class proposes a different mindset: go back to basics. Use PHP as the template language. Let a cache class do your caching. Scrap the whole "compiling" thing because that was just an outgrowth of the ever-increasing complexity of your prior attempt at a template engine. This class is not just about three main functions (or really just two) -- it's about a way-of-doing-things.
On a more positive side, for this to become usefull i would expect to see some smarty like features, a bunch of plugins, modifiers and functions. basically i would like to see a smarty (or at least a framework twards it maybe not all the functianality but at least some frameword twards it, sublassing your class to add the extra functionality is really not the way for me)
Of course, the full-on Smarty is what I'd like to avoid (which is why I named this class Dummy ;-). The purpose is to have display logic encapsulated away from the business logic, and Dummy lets you do that quickly, easily, and cleanly. Yes, anybody could write this, and anybody still can ... but this one is already written, and it has a philosophy attached to it and spelled out, and it has documentation and examples (only one now, but more coming -- don't know if you've seen how obsessive I am about docs yet ;-).
i think the point am trying to make (i just realize what it is my self), is if you will be using php as a template system just use it as it is insead of going and imitating a solution which you are trying to avoid
The thing is, templates are useful and good. We can imitate the "idea" without imitating the "implementation," I think. Dummy lets you do templates quickly and easily, without learning a new language, and provides a safe encapsulation layer for all your display logic, whatever display logic you might want to implement. As certain functions and logic become popular, they are easy to wrap into Dummy as new methods without changing the basic core of the engine -- because the basic core is still PHP. OK, so I had a little wine before I started writing; I hope I have not rambled too much. (Sorry if this was not the place to hold a philosophical discussion on templates. =) _______________________________________________________________________ Paul M. Jones pjones@ciaweb.net http://ciaweb.net PGP & GnuPG mail accepted. Public key fingerprint: 1F2D 7B8C 3FC2 820F C593 E499 1189 4AEF AA75 78C8 What's the Phorecast? http://phorecast.org/

« previous php.pear.dev (#18411) next »