Forum Moderators: phranque

Message Too Old, No Replies

Template systems for ASP or PHP

Which do you use and why?

         

Nick_W

6:28 pm on Sep 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all,

Which template system do you all use on your sites?

My favorite for PHP is Smarty [smarty.php.net]

Nick

txbakers

8:10 pm on Sep 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't use a template system. I just copy and paste what I need from various existing files. I mostly use <!-- #includes for things that are more template oriented.

ASP.

Gibble

8:14 pm on Sep 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have given up on templates, I'm now switching to XML and XSL.

It seems like it will be MUCH simpler to maintain with true data and gui seperation.

Nick_W

8:40 pm on Sep 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I envy you the xml/xsl solution! My host won't install the neccessary php stuff to support it well (sablotron i think)...

But, templates are genuine gui/content seperation. My page are nothing but php that defines the variables to be loaded into the template...

Nick

BlobFisk

11:38 am on Sep 20, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'll echo txbakers, I don't use templates for my ASP stuff, but I do use a lot of include files...

korkus2000

12:02 pm on Sep 20, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I really don't know of any ASP templates. I have never seen anyone use template software. Like txbakers and BlobFisk say most if not all ASP developers use custom includes. I know asp has includes that include a lot of objects, but these are bulky and you never use much of the stuff. With .net I guess you could consider the classes as a template, and maybe that is a little more like what you use in php.

I have been using a lot of xml/xslt and really haven't found it to be superior to other ways of creating web pages. It has its advantages and its disadvantages. Here is one large disadvantage.
[webmasterworld.com...]

ergophobe

5:55 pm on Sep 20, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



For shame Nick! You didn't answer your own question - WHY did you chose Smarty. I'm guessing it's because of the caching?

Personally, I've looked at a few templating systems and still use my own concoction. Why?
- Because I actually understand how it works,
- it's very small since it only does what I need it to do
- completely portable (I try to avoid features that may not be available on some setups, such as those running in safe mode)
- it does exactly what I want (except come up with more pleasing layouts/colors for the artistically impaired like me, but I would face that with any template system).

So what I want to know from you is why should I switch to a pre-built templating system and why smarty in particular?

Tom

Nick_W

6:10 pm on Sep 20, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Good Point!

I guess I use it mainly because it's extremly simple, yet very powerful. I love the fact that it generates PHP scripts from your templates the first time they're run. which eliminates the need to parse the template each time the page is requested.

Also, yeah, caching is spot on! It's a very versitile system and takes practically no effort to do simple stuff.

I used to use PHPLib but, well, smarty's just better, and it's developed by some of the guys that work on PHP itself.

I'm skilled enough to write my own system, and there is definately something to be said for having applications that just do what you want. But, I don't know what my next project will be untill I get it.... I like a trustworthy, comprehensive solution that in it's simplest form performs well. And if my needs are more complex, is up to the task....

BTW, I'm also aristically challenged! Check out my site ;)

Nick

jatar_k

6:22 pm on Sep 20, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I have to admit I use my own system as well.

I just don't want to mess around with some system when I can do exactly what I want myself. I would waste more time working with some system than going through my personal library and putting together the necessary components.

Just a preference but once you get your own system set up and you use it a couple of times, I think, it is more powerful and keeps you learning more.

ergophobe

6:33 pm on Sep 20, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




I'm skilled enough to write my own system,

I'm probably not - I'm sure Smarty has better design than what I do. It might be one of those things where I'm just unwilling to make the upfront investment in learning the system in order to save myself a lot of work down the line.

Tom

Nick_W

6:43 pm on Sep 20, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ahem... when I say I could write my own system I don't mean I could write somthing like Smary ;)

I've seen enoug of you and Jatars posts to know that I'm coming in last, but I what I mean is that: Sure, I could cobble something together but why bother? someones already done it way beter than I could...

Nick

jatar_k

6:52 pm on Sep 20, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



That is true, I already had a system when I heard about smarty. So, for me the opposite applies, why figure out a new system when what I have works just fine.

To each their own, why build one if someone has already made a viable solution but don't let this deter you either. If you have something that works go with it but that doesn't mean I won't mess around with smarty and possibly incorporate some of it's ideas/methods into my own. ;)

ergophobe

1:52 am on Sep 21, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




That is true, I already had a system when I heard about smarty. So, for me the opposite applies, why figure out a new system when what I have works just fine.

Yeah, that's sort of what I meant. I can recycle my function library and it all seems to work pretty well. Smarty is probably better, but I really know the way around my system.

Tom