|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
cptnemo Smarty Rookie
Joined: 09 Sep 2003 Posts: 24
|
Posted: Thu Sep 11, 2003 3:41 pm Post subject: Q about "syntax error: unrecognized tag" |
|
|
Hello all,
After fiddling about with my installation, I finally got everything working. But I ran into a problem, after trying something with associative arrays, as explained @ http://smarty.php.net/manual/en/language.variables.assoc.arrays.php. Can someone please explain what goes wrong, because I really can't see it.... Thanks!
I use a wrapper around Smarty, called ContentHandler
Quote: | class ContentHandler extends Smarty {
function ContentHandler {
$this->Smarty();
// do other constructor-stuff, set pathnames etc...
}
function setContent() {
$this->smarty->assign( 'Contacts', array('fax'=>'fax','email'=>'mail','phone'=>array('home'=>'home','cell'=>'cell')));
$this->smarty->display( 'test.tpl' );
}
}
|
with this being test.tpl:
Quote: | <div>
{Contacts.fax}
</div>
|
output:
Quote: | Fatal error: Smarty: [in test.tpl line 2]: syntax error: unrecognized tag: Contacts.fax (Smarty_Compiler.class.php, line 382) in /some/path/smarty/Smarty_Compiler.class.php on line 1824
|
|
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Sep 11, 2003 3:45 pm Post subject: |
|
|
You're going to kick yourself:
{$Contacts.fax}
|
|
Back to top |
|
cptnemo Smarty Rookie
Joined: 09 Sep 2003 Posts: 24
|
Posted: Thu Sep 11, 2003 4:23 pm Post subject: |
|
|
Aaaaaaaaaaaaaaaaagrrrhhhhhhh......
Must be the flue, I guess...
Thanks again, boots... |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|