Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Fatal error: Uncaught exception 'SmartyCompilerException'

 
Post new topic   Reply to topic    Smarty Forum Index -> Documentation
View previous topic :: View next topic  
Author Message
Vishal_2220
Smarty Rookie


Joined: 21 Aug 2014
Posts: 5

PostPosted: Mon Sep 15, 2014 1:32 pm    Post subject: Fatal error: Uncaught exception 'SmartyCompilerException' Reply with quote

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 Razz
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7366
Location: Lincoln Nebraska, USA

PostPosted: Mon Sep 15, 2014 2:57 pm    Post subject: Reply with quote

The error:

Quote:
{if @in_array( unexpected "@"


Get rid of the @.
Back to top
View user's profile Send private message Visit poster's website
Vishal_2220
Smarty Rookie


Joined: 21 Aug 2014
Posts: 5

PostPosted: Mon Sep 15, 2014 3:01 pm    Post subject: Reply with quote

Yes done!! Was that upgradation related issue?
Anyways Thanks for quick reply Smile
Is it the good practice to use PHP functions in smarty ?
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7366
Location: Lincoln Nebraska, USA

PostPosted: Mon Sep 15, 2014 9:09 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Vishal_2220
Smarty Rookie


Joined: 21 Aug 2014
Posts: 5

PostPosted: Tue Sep 16, 2014 7:40 am    Post subject: Reply with quote

Okay ..Thanks Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Documentation 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