|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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
|
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
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. |
|
#5
|
||||
|
||||
|
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.
|
|
#6
|
|||
|
|||
|
RE: storing templates?
There is also good php Template Engine callded Smarty
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Programming Theory > storing templates? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|