FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Templates in PHP Advantages...





pollux1er
Hi to every body. I am learning about using the method of templates in PHP while building website. But i really need to understand what are the advantages of using that technic. Please i you use them and you know how helpful it is, let us know here. Thank you in advance.
mathiaus
Read these two pages. They explain it all Smile

http://www.smarty.net/rightforme.php
http://www.smarty.net/whyuse.php
pollux1er
mathiaus wrote:
Read these two pages. They explain it all Smile

http://www.smarty.net/rightforme.php
http://www.smarty.net/whyuse.php


I want to know something. Is the navigation more rapid when I use templates?
grashopa
The idea of templating is simply to separate your php logic from your html to make editing both easier. But you do not need a templating engine to do that. For example smarty would change your code from <?php echo $foo ?> to { echo $foo } which is unnecessary. You do not need a templating engine to avoid making your html incomprehensible due to the amount of php inside it. Just do all your processing first, fill up some string variables and then start your html block.

For example instead of having a php block in the middle of your html that creates a table displaying a user's profile, keep the php separate and have it fill in a bunch of variables like $name $address $hobbies... and then in the html section plug them in. That way when your designer wants to change how the page looks he can easily modify the html and knows where to put the data loaded from php.
Related topics
Great php editor
Implementing your database access in PHP as a layer.
Simple PHP Navigation
PHPBB Eklentileri
SMU: Jasna's Graphics and Layouts Shop [Closed]
PHP Web Templates
Contract templates
Hoe maak je een forum met phpBB 2.0 ???
Hoe?? Uploaden naar frihost server.
[OFFICIAL] Favourite/Best CMS
Automatic download start !!
Joomla 1.5 - aanpassen footer
Flash templates
Sample website using PHP and mySQL in Linux environment
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.