Re: working on a template system...

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

 



On Wed, 2006-06-28 at 14:19, Jon Anderson wrote:
> Robert Cummings wrote:
> > Simplistic examples don't properly illustrate the mess that occurs in
> > complex situations.
> However, a simplistic example does properly illustrate my point nicely. 
> I could even take one of my complex multi-page smarty templates, run and 
> perl script to convert it, and end up with a PHP template that's just as 
> clean as the Smarty template by virtue of being basically identical.
> 
> If you split up your logic and your presentation layers, then your 
> templates can be nice and clean, even if they're written in PHP. It's 
> just much easier to shoot yourself in the foot with a PHP template.
> 
> (Again, I have nothing against Smarty or other template systems. I use 
> Smarty all the time, and I quite like it.)

Been there done that. I split my stuff up very well into modular chunks
thank-you-very-much. I still prefer a template engine. But then I guess
you like passing arrays as parameters or have set order to your function
parameters. I prefer to use custom tags where the attribute order is
unimportant. Incidentally custom tags look just like HTML, flow just
like HTML, and validate when a tag is left open. Can provide semantics
as well as content. You can keep your PHP soup.

    <?php if( userLevel( 'admin' ) ){ ?>
    blah blah blah blah blah
    <php? } ?>

    <myProject:restrict level="admin">
    blah blah blah blah blah
    </myProject:restrict>

Yep, I'm not going back.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
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