|
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 |
Vishal_2220 Smarty Rookie
Joined: 21 Aug 2014 Posts: 5
|
Posted: Mon Sep 15, 2014 1:32 pm Post subject: Fatal error: Uncaught exception 'SmartyCompilerException' |
|
|
I am getting following error
Code: | Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "C:\ccstack\htdocs\....\modules\...\templates\default\html\displaywrite.tpl" on line 946 "{if @in_array( $columnAttribute.arrayColumnValue, $dateColumns.$currLevel )}" - Unexpected "@"' in C:\ccstack\htdocs\....\include\smarty\libs\sysplugins\smarty_internal_templatecompilerbase.php:667 Stack trace: #0 C:\ccstack\htdocs\....\include\smarty\libs\sysplugins\smarty_internal_templateparser.php(3144): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 C:\ccstack\htdocs\....\include\smarty\libs\sysplugins\smarty_internal_templateparser.php(3209): Smarty_Internal_Templateparser->yy_syntax_error(62, '@') #2 C:\ccstack\htdocs\....\include\smarty\libs\sysplugins\smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doParse(62, '@') #3 C:\ccstack\htdocs\....\include\smarty\libs\sysplugins\smarty_internal_templatecompilerbase.php(206): Smarty_Internal_SmartyTempla in C:\ccstack\htdocs\....\include\smarty\libs\sysplugins\smarty_internal_templatecompilerbase.php on line 667 |
On this line Code: | {if @in_array( $columnAttribute.arrayColumnValue, $dateColumns.$currLevel )} |
What might be the reason? I have recently upgraded my smarty to 3.1.X ..
Is it okay to use php functions as modifier in conditional statement?
Is following code is right?
{if isset($abc) && $abc=='yes' }
...
{/if}
I am newbie so please forgive me if m asking stupid questions |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Sep 15, 2014 2:57 pm Post subject: |
|
|
The error:
Quote: | {if @in_array( unexpected "@" |
Get rid of the @. |
|
Back to top |
|
Vishal_2220 Smarty Rookie
Joined: 21 Aug 2014 Posts: 5
|
Posted: Mon Sep 15, 2014 3:01 pm Post subject: |
|
|
Yes done!! Was that upgradation related issue?
Anyways Thanks for quick reply
Is it the good practice to use PHP functions in smarty ? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Sep 15, 2014 9:09 pm Post subject: |
|
|
Smarty 2 was more lenient in syntax, so you could get away with that. PHP functions work fine in the template. It is your own judgement call if the php function is inside the scope of the template logic. |
|
Back to top |
|
Vishal_2220 Smarty Rookie
Joined: 21 Aug 2014 Posts: 5
|
Posted: Tue Sep 16, 2014 7:40 am Post subject: |
|
|
Okay ..Thanks |
|
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
|