PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Iron Speed
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old May 7th, 2002, 05:58 PM
Angry Coder Angry Coder is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 2 Angry Coder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question PHP: What is the best place to store templates (DB or DIR)?

Hi,

What is the best place to store templates?
I mean in a database or in a directory?

And why?

Thanks ..

Reply With Quote
  #2  
Old May 8th, 2002, 11:51 PM
MawlRats MawlRats is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 13 MawlRats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
for a template, definetly a file. one file for top template and one for bottom template. storing them in a database just makes them hard to edit, and noramlly templates are files that you edit often.

Reply With Quote
  #3  
Old May 17th, 2002, 04:11 AM
sylow sylow is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Alkmaar, Netherlands
Posts: 11 sylow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to sylow
and I can recommend you one of the best template library: Smarty. Check them out you will get surprised how great/strong templating engine it is.
You can extend the engine easily. At first it can look diffucult but dont give up. And you can use files or databases easily for your templates with it
IMHO

Reply With Quote
  #4  
Old May 22nd, 2002, 08:31 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
id say file, unless your moving your site every 5 minutes or changing something on it every 5 min, its best to have it in a dir, just one less thing in your db that you dont have to manage,

if your worried about someone finding the template and using it to somehow hack your site try this

name your template with .php at the end

in you template put something like this

<?php

if($template == "on")
{

?>
html code here
<?php } ?>

then when you call the template

add this line

$template = "on";

this way if someone finds the template and trys to load it they'll get a blank page! with none of your code at all!

that measure is a bit drastic, but it works hehe

Reply With Quote
  #5  
Old June 6th, 2002, 11:10 PM
Spyder Spyder is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Australia
Posts: 5 Spyder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Spyder Send a message via AIM to Spyder Send a message via Yahoo to Spyder
Like sylow mentions, Smarty is an excellent template system with heaps of flexibility... You can store your templates wherever you want and Smarty can cache the output for greater performance...

Check it out: http://www.phpinsider.com/php/code/Smarty/ or http://smarty.php.net/

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > PHP: What is the best place to store templates (DB or DIR)?


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!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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

Iron Speed




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