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: 3
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: 3
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"
Click here for more information.
 
Join Date: Apr 2007
Location: Jacksonville, Fl
Posts: 4,775 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 13 h 47 m 18 sec
Reputation Power: 7
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: 3
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




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

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




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 10 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek