View previous topic :: View next topic |
Author |
Message |
kaustuva Smarty n00b
Joined: 11 Nov 2012 Posts: 2
|
Posted: Sun Nov 11, 2012 9:07 am Post subject: SmartyCompilerException error |
|
|
Hi,
I am having following error please help me.
[Sun Nov 11 08:57:29 2012] [error] [client 10.1.1.102] PHP Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "../templates/main.tpl" on line 1 "{include file=header.tpl}" - Unexpected ".", expected one of: "}" , " " , ATTR' in /usr/share/smarty/sysplugins/smarty_internal_templatecompilerbase.php:657\nStack trace:\n#0 /usr/share/smarty/sysplugins/smarty_internal_templateparser.php(3144): Smarty_Internal_TemplateCompilerBase->trigger_template_error()\n#1 /usr/share/smarty/sysplugins/smarty_internal_templateparser.php(3209): Smarty_Internal_Templateparser->yy_syntax_error(59, '.')\n#2 /usr/share/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doParse(59, '.')\n#3 /usr/share/smarty/sysplugins/smarty_internal_templatecompilerbase.php(192): Smarty_Internal_SmartyTemplateCompiler->doCompile('{include file=h...')\n#4 /usr/share/smarty/sysplugins/smarty_internal_template.php(187): Smarty_Internal_TemplateCompilerBase->compileTemplate(Object(Smarty in /usr/share/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 657
Regards,
Kaustuva |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Nov 11, 2012 10:09 am Post subject: |
|
|
Smarty3 is more strict on strings, which always must be quoted.
Code: | {include file='header.tpl'} |
|
|
Back to top |
|
kaustuva Smarty n00b
Joined: 11 Nov 2012 Posts: 2
|
Posted: Sun Nov 11, 2012 10:12 am Post subject: |
|
|
thank you. Already I did that. |
|
Back to top |
|
heal Smarty Rookie
Joined: 11 Mar 2013 Posts: 7
|
Posted: Mon Mar 11, 2013 1:26 pm Post subject: same error |
|
|
Hello, I have the same error, but I have quoted the filename.
Code: | Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/data/www/site/_xhtml3/advent.tpl" on line 27 "{include file="footer.tpl"}" - Unexpected """, expected one of: "identifier"' ... |
What's wrong with my code?
this don't works: Code: | {include file='header.tpl'} |
but this works: Code: | {include 'header.tpl'} |
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Mar 12, 2013 4:37 pm Post subject: |
|
|
I can't reproduce your problem.
{include file='header.tpl'}
{include 'header.tpl'}
{include file="header.tpl"}
{include "header.tpl"}
All of above versions do work.
Which version of Smarty did you use?
Could your editor have added some not visable characters? |
|
Back to top |
|
heal Smarty Rookie
Joined: 11 Mar 2013 Posts: 7
|
Posted: Tue Mar 12, 2013 5:05 pm Post subject: |
|
|
I'm using 3.1.13.
No, there aren't invisible characters in those lines.
I'm using VIM, checked the hidden characters with :set invlist
Screenshot: image sorry, here is a better screenshot: image2 |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Mar 12, 2013 5:35 pm Post subject: |
|
|
Just an idea, when you have upgraded in the past did you:
) clear out all old files and replace with new files (for smarty core libs)
) clear out all compiled files
) clear out all cache files |
|
Back to top |
|
heal Smarty Rookie
Joined: 11 Mar 2013 Posts: 7
|
Posted: Tue Mar 12, 2013 5:38 pm Post subject: |
|
|
Yes.
I have downloaded the new version to other directory and included from there.
I have deleted all compiled files.
I don't use cache.
As an extra thing, the new smarty throws errors only on my production server. On my home server (same, apache, php, smarty) there are no errors. I don't understand this, because on my home server my templates are still in old format and those works with v3.1.13. without any errors. :/ |
|
Back to top |
|
|