Re: Play nice! Re: Savant/Flexy/Foo template engines

From: Date: Wed, 09 Jun 2004 13:59:43 +0000
Subject: Re: Play nice! Re: Savant/Flexy/Foo template engines
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-30283@lists.php.net to get a copy of this message
On Jun 9, 2004, at 3:22 PM, Greg Beaver wrote:
Here's the deal. The is *overwhelming* demand for Savant in PEAR, me included.
Great to hear that :D
I see this as an opportunity to provide a common template interface to some existing template engines. Alan has demonstrated that it would require very little modification to Flexy to make it extend a Savant-like template engine with his recent CVS commits.
yes but Alan said "I do believe a unified engine is the way to go, unfortunatly, Savant already has a number of serious design issues, = Poorly designed Loader / API for plugins. = Not a very generic API" I personally disagree.
Why don't we stop arguing about whether Savant will be in PEAR, and instead argue about how it will be in PEAR. Clearly, there is a significant need for a minimalist template engine, and Savant is that. In order to allow users to comfortably switch to a different engine if their requirements change would be a good thing for Savant, and a good thing for PEAR and by consequence, for PHP.
I agree on that but if synergy is not possible let it be. As I user I don't think I would welcome a uber-template when I could use and benefit largely for what Savant has to offer.
Scenario: I start using Savant as the template engine frontend for my website example.com. The site becomes popular, and users have lots of content to offer, so I would like to make it possible for them to code some pages. I can't offer them full access, and so the security risk of allowing access to PHP tags through Savant templates is unacceptable.
Not entirely sure but since I use Savant extensively both on a person and a professional site, here is my scenario: a) If I hire a graphic designer I simply give him the .tmp.php files. With any editor like Adobe Golive/Dreamweaver he can see the blue area which made up the php tags and he will not mess with that. b) the same issue of "messing up" the page might occur with smarty: e.g. <body> User Information:<p> Name: {$name}<br> Address: {$address}<br> If the contributor deletes the {} tags all is gone. The difference is that Savant will keep it as it should be, PHP. If you mean the risk of using php to do some exec or nasty stuff, well if the contributor has access to the CVS or FTP nothing stops him to upload his own script or overwrite my pages. c) I wouldn't allow access to a page to someone who is not able to read the code and pay attention to the php part ;)
Instead, I load the handy Flexy extension (or the handy patTemplate, or the handy IT, or whatever extension is available), and allow my users to write templates in Flexy, with specific security limitations built-in. The templates are compiled, and then displayed using Savant just as any other template would be.
This is one of the main differences. I don't think that a Smarty user, which is entirely happy with the {} marks and sees them as a benefit using Savant or the other way around. Don't get me wrong, I see your point. Just from the previous mail list discussion I have realized how different are the existing templates with Savant.
I hope this example shows why it is so critical that we look past any small differences over the way things are now - this is a genuine opportunity to expand the range of templating in PHP. Let's make Savant a base, and with the collaboration of several developers who know what they're doing (Paul, Alan, and if other template maintainers jump on board, that's great), build extensions that will support the things that users of existing template engines have come to expect. In addition, it's very clear from recent messages that Paul and Alan can work out a base that differs slightly from existing Savant, and slightly from Alan's port of Savant into Flexy that combines the strengths of both. I'm willing to help as long as I don't get in the way, not being the templating expert that these folks are.
If the existing templates are really that similar then cooperating should be a natural step. Apparently they aren't that similar. I don't think Sigma maintainer would welcome the idea (he already expressed his view on this regard) and, unless I got it all wrong, Alan idea was to embed/add the Savant functionality to Flexy. Eventually I am grateful to you Greg. You where the first to mention Savant and I tried it without much hope and I was pleased to be wrong. As you say let's play nice : the code is good, PEAR compliant, very well documented, different (yes it is different. Unless you think that a non compiling and non caching library is the same of a compiling template engine) so I don't really see why it should be excluded. Regards David Costa
Greg -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


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