Re: concatenation operator...?
| From: | Andrei Zmievski | Date: | Tue, 26 Jun 2001 16:17:41 +0000 |
| Subject: | Re: concatenation operator...? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-984@lists.php.net to get a copy of this message | ||
On Tue, 26 Jun 2001, Mike Krus wrote:
> Andrei Zmievski wrote:
>
> > Try this:
> >
> > {include file=header.tpl title="Admin - $title"}
> this doesn't work if you don't want white space:
>
> {include file=header.tpl title="$titleAdmin"}
> would look for variable $titleAdmin rather than append
> Admin to the content of variable $title
Correct, that is a problem. However, Smarty lacks the concept of
operators as such, so it doesn't make sense to talk about 'concatenation
operator'. Something like this might be achieved via modifiers, but that
means we'd have to allow applying modifiers to static strings:
{"Admin - "|concat:$title}
> Also: you don't seem to be able to put config variables in
> strings:
> {include file=header.tpl title="#title# Admin"}
> #title# doesn't get expanded. You can probably work around
> it by using {assign var=title value=#title#} first...
Same idea as above.
-Andrei
When we eliminate the impossible, whatever remains,
however improbable, must be true. -- Sherlock Holmes