|
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 |
tunde_ajao Smarty Rookie
Joined: 23 Aug 2011 Posts: 8
|
Posted: Wed Aug 24, 2011 12:48 pm Post subject: Just Not there Yet! |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Aug 25, 2011 6:12 pm Post subject: |
|
|
The template variable $tbl has no assigned value |
|
Back to top |
|
epcliff Smarty n00b
Joined: 09 Sep 2011 Posts: 2
|
Posted: Fri Sep 09, 2011 2:24 pm Post subject: |
|
|
Hi I have the same problem. How do you assign the $tbl? I'm new to smarty. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Sep 09, 2011 2:49 pm Post subject: |
|
|
Every template variable must be assigned in the PHP script.
Example
$smarty->assign('varname',$value) |
|
Back to top |
|
epcliff Smarty n00b
Joined: 09 Sep 2011 Posts: 2
|
Posted: Fri Sep 09, 2011 3:57 pm Post subject: |
|
|
thanks for your reply U.Tews. I got it working.
Instead of just $tbl.index, i used $smarty.section.tbl.index |
|
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
|