Re: Re: Templating engines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> You also need to recognize that you are going to need presentation-layer
> logic.  You simply can't get around that and you shouldn't confuse
> presentation-level logic, which can be quite complex, with the business
> logic behind your application.  I often see people make the mistake of
> trying to separate their PHP code from their HTML which the article you
> referenced hinted at as well.

Yes, I completely agree that business logic should be separated from
presentation logic. Only problem I have is that from there people go on to
conclude that html does not need to be sseparated from presentation logic.
As far as I see It is a very good idea to keep all 3 of them separated.
Bussines logic from presentation logic by proper organization and code
design in php, and presentation logic from html by template engine.

> My main issue with general-purpose templating systems is that they
> always end up inventing a new language.  It may start off as a subset of
> some other language, but eventually it turns into a new language.  In
> Smarty, for example, you now have stuff like:

They have to define markup language, (begin/end of template, free variable
marker), but we are not talking about that.

What usually is the problem is that template systems define its own
programming language, with constrructs for loops, if's and whole other bunch
of stuff to model dynamic behavior. And I agree with you that this makes
diffrence between using such template system, and just php as template
system much, much smaller.

Where I do not agree, is that "fat template" syndrom is common to all
template engines, and that it is inveitable. For instance my TemplateTamer,
is now almost 5 years old, and it never had any sign of becomming
programming language in it self, and it never will. It has a markup language
of only 6 idioms:

<!--NAME: -->
<!--END: -->
<!--GLOBAL: -->
<!--USEGLOBAL: -->
{VARIABLE}
{#TRANSLATE}

and there is no single sign of presentation logic inside html template, no
ifs, no loops, no calls to the methods or functions, nada. All presentation
logic is written in php, and in nicely separated logic.php file.

rush
--
http://www.templatetamer.com/
http://www.folderscavenger.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux