crawlerbasher Posted April 3, 2010 Share Posted April 3, 2010 Ok I don't know where to begin to look for the information I need. So I'm posting here so that some one might have an idea from what I've described. And help me find what I'm looking for. I would like to be able to use a php script that could phase a HTML and add part of its codes to the HTML its phased. So where it would have in the HTML code {comment} {date} {name} {Race} {Nation} {Rank} {email} {url} etc... Then it would put in the place of it the output from the database to them markings. eg.. Where it says {email} it would be replace with a HTML code like mailto: and then the information from the database. If you understand what I'm trying to get at. Could you please help me find a good tutorial on doing somthing like this. Thank You. Link to comment https://forums.phpfreaks.com/topic/197421-template-design/ Share on other sites More sharing options...
trq Posted April 3, 2010 Share Posted April 3, 2010 Is there any particular reason you think you need this? These template parsers generally just add extra overhead for no real benefit. Link to comment https://forums.phpfreaks.com/topic/197421-template-design/#findComment-1036224 Share on other sites More sharing options...
crawlerbasher Posted April 3, 2010 Author Share Posted April 3, 2010 its so that others can creat custom templates or to intergrate the guest book into there site. Link to comment https://forums.phpfreaks.com/topic/197421-template-design/#findComment-1036225 Share on other sites More sharing options...
trq Posted April 3, 2010 Share Posted April 3, 2010 Still, I don't see the benefits. What is the major benefits between something like.... <html> <head> <title>{title}</title> </head> <body> {foreach: item} <div class="article"> <h1>{item: title}</h1> <p>{item: content}</p> </div> {end: item} </body> </html> and..... <html> <head> <title><?php echo $title ?></title> </head> <body> <?php foreach ($item as $i}: ?> <div class="article"> <h1><?php echo $i->title ?></h1> <p><?php echo $i->content ?></p> </div> <?php endforeach; ?> </body> </html> None. Designers need to learn a new syntax anyway. That syntax may as well be some simple php for a number of reasons. Including the fact that there are many IDE's around that support it (hell, even our forum highlights it). Link to comment https://forums.phpfreaks.com/topic/197421-template-design/#findComment-1036227 Share on other sites More sharing options...
Tazerenix Posted April 3, 2010 Share Posted April 3, 2010 because if you parse code in PHP and then store it you can cache it. But from what i can tell you wouldnt be able to cache that. But i could be wrong, im no expert Link to comment https://forums.phpfreaks.com/topic/197421-template-design/#findComment-1036246 Share on other sites More sharing options...
hackalive Posted April 3, 2010 Share Posted April 3, 2010 What about using "Smarty" templates? Link to comment https://forums.phpfreaks.com/topic/197421-template-design/#findComment-1036256 Share on other sites More sharing options...
crawlerbasher Posted April 3, 2010 Author Share Posted April 3, 2010 Whats Smarty templates? The only resion I've seen {comment} in templates becuase of somthing like it on the phpbb style forum. Where ppl can customize the forum template. Link to comment https://forums.phpfreaks.com/topic/197421-template-design/#findComment-1036258 Share on other sites More sharing options...
hackalive Posted April 3, 2010 Share Posted April 3, 2010 http://www.smarty.net/ its a template engine for PHP Link to comment https://forums.phpfreaks.com/topic/197421-template-design/#findComment-1036259 Share on other sites More sharing options...
trq Posted April 3, 2010 Share Posted April 3, 2010 Whats Smarty templates? The only resion I've seen {comment} in templates becuase of somthing like it on the phpbb style forum. Where ppl can customize the forum template. Smarty is a template engine. Like I said though, its overhead for no benefit. PHPBB isn't exactly a good benchmark for application design. Link to comment https://forums.phpfreaks.com/topic/197421-template-design/#findComment-1036263 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.