Re: [SMARTY] Embedding variables into parameters for the {include} command
| From: | messju mohr | Date: | Fri, 29 Aug 2003 09:29:51 +0000 |
| Subject: | Re: [SMARTY] Embedding variables into parameters for the {include} command | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10150@lists.php.net to get a copy of this message | ||
On Thu, Aug 28, 2003 at 11:17:20PM +0200, messju mohr wrote:
> On Thu, Aug 28, 2003 at 07:41:33PM +0000, Richard Jones wrote:
> > Hi all,
> > I've been using smarty for a couple of months now, and i've run into an
> > annoying problem.. i'm sure i'm missing an obvious solution..
> >
> > I include a header atop each template, passing it the title to use in the html
> > <title> tags
> >
> > the title is chosen depending on page content, for example:
> >
> > {include file="header.tpl" title="User Details ::
> > {$name|htmlentities}"}
>
> {include file="header.tpl" title="User Details :: $name"|htmlentities}
>
> should do
on second thought (and after reading the other posts):
simply {include file="header.tpl" title="User Details :: $name"}
and doing the htmlentities in header.tpl and not in the include
statement looks even cleaner to me
maybe some day you want to use the title inside javascript or so and
need a different encoding than "htmlentities". "header.tpl" show know
best how to escape $title for it's purposes.
greetings
messju