Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Q about "syntax error: unrecognized tag"

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
cptnemo
Smarty Rookie


Joined: 09 Sep 2003
Posts: 24

PostPosted: Thu Sep 11, 2003 3:41 pm    Post subject: Q about "syntax error: unrecognized tag" Reply with quote

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
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu Sep 11, 2003 3:45 pm    Post subject: Reply with quote

You're going to kick yourself:

{$Contacts.fax}

Smile
Back to top
View user's profile Send private message
cptnemo
Smarty Rookie


Joined: 09 Sep 2003
Posts: 24

PostPosted: Thu Sep 11, 2003 4:23 pm    Post subject: Reply with quote

Aaaaaaaaaaaaaaaaagrrrhhhhhhh......

Must be the flue, I guess...

Thanks again, boots...
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP