Re: [SMARTY-DEV] RE: [SMARTY] {literal} + variabel
| From: | Monte Ohrt | Date: | Mon, 05 May 2003 14:05:16 +0000 |
| Subject: | Re: [SMARTY-DEV] RE: [SMARTY] {literal} + variabel | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1341@lists.php.net to get a copy of this message | ||
What if smarty didn't recognize /{\s/ as a starting delimiter tag?
Seriously, who writes template functions like this:
{ myfunc var = "foo" }
or variables like this:
{ $foobar }
If we don't allow that, then things like:
function foo() {
blah();
}
Would never get interpreted in the first place.
Someone could conceivably write javascript code all bunched together:
function foo() {blah();}
In which case the braces need escaping when braces are the delimiter, no
different than what we have now.
Monte
On Sun, 2003-05-04 at 09:09, boots wrote:
> --- Gary Loescher <gary@loescher.org> wrote:
> > I was thinking about this recently. We could add a {script}
> > ...{/script} block that temporarily switches the delimiters to "{{"
> > and "}}". Or, better yet, recognizes repeated delimiters, since they
> > are changeable ("<!--{<!--{")...
>
> I like this.
>
> >I wouldn't change the {literal} tag, since semantically it means "no
> > parsing whatsoever."
>
> Perhaps an attribute on literal to control behaviour. A new tag would
> be okay, too.
>
> As an alternative, how about this: pass-through {...} embedded in
> {literal} blocks (or {code} blocks or whatever} only if they don't
> contain valid Smarty. Passed blocks would have to be checked to see if
> they contain embedded Smarty.
>
> eg.
>
> {code}
> <style>
> body { background:{#background#}; }
> </style>
> {/code}
>
> The innermost {.} is valid Smarty and would be replaced, while the
> outermost {.} is passed-through *after* the inner replacement. Probably
> not very efficient, though.
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
--
Monte Ohrt <monte@ispi.net>