reconraiders 0 Report post Posted June 8, 2007 Can anybody here please explain to me a little bit about PHP template systems. I've seen them in forum systems that I've used before like phpBB and MyBB. I've never really understood how they work exactly. I'd like to make my own sometime too. If you can give me any simple advice or complex, that would be cool. Or just point me to a good tutorial or something maybe? Thanks. Share this post Link to post Share on other sites
Azeri_boy 0 Report post Posted June 8, 2007 I don't believe that in internet there is comprehensive tutorial for that. This is very long topic. But main idea is to separate design and php coding so that designer could edit veiw of site without php knowledge. For example: <head> <title>{site_title}</title> </head> <META http-equiv="content-type" content="text/html"; charset="{site_charset}"> <META name="Keywords" content="{site_keywords}"> <META name="Description" content="{site_description}"> <META name="Author" content="AztEK (zhkot@bk.ru)"> <LINK href="skins/guest/{guest_skin}/style.css" type="text/css" rel="stylesheet"></head>This is header part of one guestbook(real). As you see there is no exact value for site charset, title and so on. These words that in {} will be replaced by its set values in server side. If you want to change or add some tags you don't need to know php.If you want to make proffesional template supporting projects the best way is to buy book and begin to read and try. Share this post Link to post Share on other sites
reconraiders 0 Report post Posted June 8, 2007 I understand what they do but I don't understand exactly HOW they work. Does a script just parse all everything on the template page and look for the "{" and "}" and then replace that with some dynamic string? Share this post Link to post Share on other sites
arza1 0 Report post Posted June 9, 2007 all this sound so counfusing because all i know is html coding. php is so hard to understand. i think someone should try making a forum tutorial on this site to help everyone out. Share this post Link to post Share on other sites
Azeri_boy 0 Report post Posted June 9, 2007 (edited) I understand what they do but I don't understand exactly HOW they work. Does a script just parse all everything on the template page and look for the "{" and "}" and then replace that with some dynamic string?If you use {someting} -style template pages must be parsed and replaced with certain values. It takes time. Best way is simply to use <?=$somevalue ?> -style. In this case server itself will replace variables with its values.Take a look to this article :http://www.massassi.com/php/articles/template_engines/ Edited June 9, 2007 by Azeri_boy (see edit history) Share this post Link to post Share on other sites
reconraiders 0 Report post Posted June 13, 2007 I found a little tutorial on templates. It's not too bad. I think I will base mine on it, but develop it further. The script in the tutorial is relatively simple and kinda inefficient. But it's a good start for what I was looking for.Here's the linkhttp://forums.xisto.com/no_longer_exists/ Share this post Link to post Share on other sites
randompage 0 Report post Posted June 15, 2007 hi,before u can use php template system, u should have preliminary knowledge on php+html.the simplest and i still use it till now, is fasttemplate. its not developed again, but it's so mature and easy to use. there's no programming at all in template.most modern template system allow u to insert small program there.btw,why we should use template system?a. to separate between html and programming (php) part. so, designer and programming can start work together in the same time.b. make the html easy to maintain. most designer use wysiwyg html editor, in contrast, programmer use text editorc. make the source code cleaner, because all html part reside on the template.that's all i know for now..cheers, Share this post Link to post Share on other sites
Blessed 0 Report post Posted June 16, 2007 Greetingnice links man,thanx for the links,this really helps me allot.have a nice day.God Bless you guy's Share this post Link to post Share on other sites
delivi 0 Report post Posted August 20, 2007 using PHP templates for the site helps us to reduce the time spent on designing each pages in our websites, all we've to do is design it once and forget it and the template will be applied to all the other pages by including the necessary files in each page. Share this post Link to post Share on other sites