[UPHPU] Template engines

Josh Jeppson uphpu at josh.jeppsons.org
Wed Oct 11 14:15:58 MDT 2006


On 10/10/06, Wayne Jensen <jensenw at gmail.com> wrote:
>
> P.S. I just remembered the other thing that drove me nuts about Smarty
> when I was using it... the {literal}{/literal} was extremely buggy
> when trying to make Smarty not parse Javascript and CSS.  I don't know
> if that's been fixed since then or not because that was a couple of
> years ago.  ...and sure, I know I should have just separated the CSS
> and Javascript out into their own files, but... well... nevermind, I
> don't have a good excuse.
>

Change the left and right delimiter to something less common and this
problem goes away.  It is possible to use multicharacter delimiters.  For
example, in the project I'm currently working on we use {[ and ]} for the
delimiters. In past projects we've used other combinations like <!--{ and
}--> which looks like an html comment to graphical html editors.
Of course, those delimiters will cause some highlighting editors to freak
out when used inside of an html tag's attributes.  Regardless, the defaults
of { and } are, in my mind, too common and easy to confuse with javascript
or style blocks.

See http://smarty.php.net/manual/en/variable.left.delimiter.php and
http://smarty.php.net/manual/en/variable.right.delimiter.php

- Josh


More information about the UPHPU mailing list