zalafa Posted July 15, 2014 Share Posted July 15, 2014 I've created custom page using custom controller point to custom tpl the code inside custom tpl "cek-resi.tpl" <h1>Cek Resi Disini</h1> {php} echo 'sdf'; {/php} error logs http://zalafa.com/en/cekresi Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/home/zalafaco/public_html/themes/default-bootstrap/cek-resi.tpl" on line 3 "{php} echo 'sdf'; {/php}" unknown tag "php"' in /home/zalafaco/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:667 Stack trace: #0 /home/zalafaco/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php(453): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown tag "ph...', 3) #1 /home/zalafaco/public_html/tools/smarty/sysplugins/smarty_internal_templateparser.php(2393): Smarty_Internal_TemplateCompilerBase->compileTag('php', Array) #2 /home/zalafaco/public_html/tools/smarty/sysplugins/smarty_internal_templateparser.php(3101): Smarty_Internal_Templateparser->yy_r37() #3 /home/zalafaco/public_html/tools/smarty/sysplugins/smarty_internal_templateparser.php(3201): Smarty_Internal_Templateparser->yy_reduce(37) #4 /home/zalafaco/public_html/tools/smarty/sysplu in /home/zalafaco/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 667 what did i do wrong here? Link to comment Share on other sites More sharing options...
Eolia Posted July 15, 2014 Share Posted July 15, 2014 (edited) Smarty doc. : This is for advanced users only, not normally needed and not recommended. And the Prestashop doc: Do not make direct PHP calls. For instance, do not use {php} // PHP code {/php} Use the assign method to use variables or smarty functions. A lot of Prestashop functions & methods can be used in tpl files... Here, your echo function is useless, type directly: <h1>Cek Resi Disini</h1> sdf Edited July 15, 2014 by Eolia (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 15, 2014 Share Posted July 15, 2014 prestashop from 1.5 version doesnt allow to use {php} tags in .tpl files use your php code in controller, not in tpl file this is because of MVC model, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now