PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



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:
  #1  
Old May 7th, 2002, 05:58 PM
Angry Coder Angry Coder is offline
Registered User
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
Registered User
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
Registered User
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
Registered User
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)?


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap