Programming Theory
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesProgramming Theory

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old July 21st, 2006, 03:50 PM
tyrsal tyrsal is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 17 tyrsal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 sec
Reputation Power: 0
Send a message via AIM to tyrsal
storing templates?

So, I was wondering.. what would be the best way to store templates?

I don't want to store them in the database, because the only person who will be changing these tamplates is ME, through the php code. so there is no reason to waste time doing SQL queries and such.

I was thinkin I had a few options. I could store the templates:

- in a switch() statement
- in *.tpl files
- in a class

what I'll be doing is grabbing the template (which is riddled with my faux {%TAGNAME%} tags), and replacing each tag with a value that I'll be getting. the reason for using templates is so I don't have to repeat the HTML code in a dozen different places.

So! which one is better?

Reply With Quote
  #2  
Old July 24th, 2006, 09:22 PM
y0y y0y is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Raleigh, NC
Posts: 140 y0y User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 11 sec
Reputation Power: 2
Send a message via AIM to y0y
RE: storing templates?

I can't see any reason not to store templates in their own files (tpl being my preferred extension) as you would class files or html. Not everything belongs in a database

Reply With Quote
  #3  
Old July 26th, 2006, 06:15 PM
tyrsal tyrsal is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 17 tyrsal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 sec
Reputation Power: 0
Send a message via AIM to tyrsal
RE: storing templates?

that's what I decided on. I still wonder which is faster, though. Maybe I will find time to tes t that hwen this is all done.

Reply With Quote
  #4  
Old July 26th, 2006, 09:39 PM
y0y y0y is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Raleigh, NC
Posts: 140 y0y User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 11 sec
Reputation Power: 2
Send a message via AIM to y0y
RE: storing templates?

Faster?

Regardless you're reading the template from disk. The speed differences will be negligible. If you're worried about speed, add cacheing.

Reply With Quote
  #5  
Old July 26th, 2006, 11:23 PM
lig's Avatar
lig lig is offline
"Forum Nazi"
Codewalkers Demi-God (4500 - 4999 posts)
 
Join Date: Apr 2007
Location: Jacksonville, Fl
Posts: 4,727 lig User rank is Private First Class (20 - 50 Reputation Level)lig User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 1 h 4 m 45 sec
Reputation Power: 6
RE: storing templates?

I personally save my templates in a template file off the web root with the extension .tpl.php whether they are smarty of straight html/php templates.

Reply With Quote
  #6  
Old October 10th, 2006, 07:28 AM
bsaksida bsaksida is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Slovenia Ljubljana
Posts: 188 bsaksida User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to bsaksida
RE: storing templates?

There is also good php Template Engine callded Smarty

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesProgramming Theory > storing templates?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway