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

Just Not there Yet!

 
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 -> General
View previous topic :: View next topic  
Author Message
tunde_ajao
Smarty Rookie


Joined: 23 Aug 2011
Posts: 8

PostPosted: Wed Aug 24, 2011 12:48 pm    Post subject: Just Not there Yet! Reply with quote

I had an initial problem in the tpl file that it had difficulty accepting the “%” is had produce an error, Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "index.tpl" on line 55 "{if %tbl.index% is odd}" - Unexpected "%"

With some good advice I changed the removed the “%” and put "{if $tbl.index is odd}" this was wonderful and it produced the excepted result.

But there was an error at the top of the page

try
Notice: Undefined variable: tbl in C:\Program Files\EasyPHP 2.0\www\Smarty\sysplugins\smarty_internal_data.php on line 291


Does anyone know the solution?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu Aug 25, 2011 6:12 pm    Post subject: Reply with quote

The template variable $tbl has no assigned value
Back to top
View user's profile Send private message
epcliff
Smarty n00b


Joined: 09 Sep 2011
Posts: 2

PostPosted: Fri Sep 09, 2011 2:24 pm    Post subject: Reply with quote

Hi I have the same problem. How do you assign the $tbl? I'm new to smarty.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Fri Sep 09, 2011 2:49 pm    Post subject: Reply with quote

Every template variable must be assigned in the PHP script.

Example

$smarty->assign('varname',$value)
Back to top
View user's profile Send private message
epcliff
Smarty n00b


Joined: 09 Sep 2011
Posts: 2

PostPosted: Fri Sep 09, 2011 3:57 pm    Post subject: Reply with quote

thanks for your reply U.Tews. I got it working.

Instead of just $tbl.index, i used $smarty.section.tbl.index
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 -> General 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