Embedding variables into parameters for the {include} command
| From: | Richard Jones | Date: | Thu, 28 Aug 2003 19:41:33 +0000 |
| Subject: | Embedding variables into parameters for the {include} command | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-10143@lists.php.net to get a copy of this message | ||
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}"}
except this doesn't work..
Fatal error: Smarty: [in user.tpl line 1]: syntax error: expecting '=' after
attribute name 'Details' (Smarty_Compiler.class.php, line 1342) in
/usr/local/lib/php/Smarty_Compiler.class.php on line 1824
omitting the {} around the embedded variable $name doesnt work either.. i just
prints the "$name|htmlentities" literally
There are occasions where i wish to use $userobject->getName() as part of the
title parameter too..
any suggestions?
Thanks,
Richard