templates?



Hi,

i want to rewrite my website to separate the php script from the HTML code.
Therefore a web designer can update the design of the website without any
knowledge in PHP.

I read a lot of information about several templates like PhpLib,
FastTemplates, Smarty etc etc.

Some do not have a specific language so you cannot do complex things.
For example it's not easy to display a table (sometimes you need to have a
specific template to display the TR HTML tags...).
, it's not easy to use a different color to display a table row according to
a parameter etc etc

Some have a specific language, like Smarty.

My question is, what is the interest to learn another language??
What is the real interest of Smarty (or other one)?

What is the difference between these 2 situations:
I explain to a webdesigner this code:
{section name=sec1 loop=$contacts}
phone: {$contacts[sec1].phone}<br>
fax: {$contacts[sec1].fax}<br>
cell: {$contacts[sec1].cell}<br>
{/section}

Or I explain this:
foreach($contacts as $key=>$contact){
phone: <? echo $contact["phone"]?><br>
fax: <? echo $contact["fax"]?> <br>
cell: <? echo $contact["cell"]?> <br>
}

So I really think it's better to have;
- a php script which set some variables
- a HTML templates which build the content of the page. It uses a lot of
HTML tags and of course some really basic php function (if, foreach, echo).

Of course the php script call the HTML template.
You only use php, you work with the same variables, you don't need to call
some specific functions (assign etc etc), you don't need to know another
language etc etc.

Am I wrong??

Is there any interest to use Smarty (or other one)??
Why do they exist??????
And maybe why do YOU use them????

Manys thanks

Rod


.



Relevant Pages

  • templates?
    ... i want to rewrite my website to separate the php script from the HTML code. ... Some do not have a specific language so you cannot do complex things. ... like Smarty. ...
    (alt.php)
  • Re: Directory / File Indexing - Structure Question
    ... In the Notes directory I have a php script which echoes links to each sub ... will write a file called index.html to the selected sub directory and then ... I am OK with most of it except how to switch to the index.html file from a ... I read a comment somewhere that php is not html so doesn't ...
    (comp.lang.php)
  • Re: user-updated content
    ... editable areas - the page content. ... which is then converted into a html file by a php script on the ... probably thinking in terms of preparing their text in Word (which might ... suggest something like RTF -> HTML conversion might be better), ...
    (uk.net.web.authoring)
  • Re: How do I setup php script to return a browser page?
    ... the php script will need to change a couple html lines in that ... I'm still pretty new at html and ... So basically, when the form is submitted, the post data is used for the ... abuse assuming the data will go into a database at some point. ...
    (comp.lang.php)
  • Re: Language Script
    ... > does any know of any php script which can change the language of the ... > webpage on the fly, i have seen many websites which have several ...
    (comp.lang.php)