You are here: templates? « All PHP « IT news, forums, messages
templates?

Posted by WebRod on 10/10/14 11:17

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация