Thread: patTemplate
View Single Post
Old January 29th, 2005, 13:34   #102
MasterChief
 
MasterChief's Avatar
 
Join Date: Oct 2003
Location: Australia
Posts: 1,036
MasterChief is on a distinguished road
Default

Quote:
Originally Posted by gsbe
Do you find that patTemplate suffers from the same flaw as Smarty
It's a technique but certainly not a flaw. Yes, pure PHP has speed advantages but it's not true to the MVC paradigm (for example, you can modify underlying model and data with you template file).

I choose patTemplte becase templates are comlpetely HTML looking. All of the structural markup is in XML and your field codes, as you point out, are wrapped in {}. I believe this will make it so much easier to develop components and the presentation layer with Mambo (though I still believe Mambo now is one of the easiest of the CMS's to code for...despite what drupal zealots think, hehe).

In 5.0 we will have the whole interface running off pat's templates. This means that a graphic designer, with no PHP experience, can be given a specification of where to find the files to change for a particular area fo the screen. Might hope when he/she first opens the file is they will think "hmm, this looks a lot like html with some funny XML tags, but I think I can see the structure of the page".

Couple of other reasons are that the pat files are html, they are not executable so even if they are opened directly they can't pose a security risk. Also, pat can't change data within the php script. With php based templating systems it's possible for the graphic designer to throw in a database call to update a table.

On technical points, the library is not too bloated (neither is Savant). Creating new 'tags' is a piece of cake, eg:

<mos:Mambo macro="loadModule" position="left" />

Development is also fairly current and the author is very approachable (this is also the case for a number of other systems).

Please note that these are just some of my reasons for selecting patTemplate. It's not that Savant or Smarty are wrong or not suitable, etc (although I do find Smarty rather bloated).

I must admit it's a big decision to go with a templating system. I used to hate the idea with a passion...couldn't see the logic in it. Well, I do now One test that you have at least *appeared* to have made the right decision is after you spend a lot of time redesigning and testing in the template system, and go back to an old job or old part of the code and think "YUCK, I wish this was done the new way, it would be so much easier to edit".
__________________
Andrew Eddie
<><
Mambo Core Developer February 2003-August 2005
http://www.jamboworks.com ...
MasterChief is offline   Reply With Quote