|
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 |
Andrew_M Smarty n00b
Joined: 04 Mar 2015 Posts: 2
|
Posted: Fri Sep 11, 2015 2:41 pm Post subject: Can't use php in templates |
|
|
I'm trying to create a tpl called billet.tpl for payment methods in cs-cart and I'd need to use PHP on it to get some informations about the order and to generate the URL to the billet but every time I put {php} {/php} on it I get an error (500 Internal Server Error) when I try to change to this new payment method as customer. This is the code:
Code: | {php}
global $base_domain;
$orderInfo = $this->get_template_vars('order_info');
.
.
.
{/php}
<br>
<input type="radio" name="billet_radio" checked/>Billet Payment |
This is the console error:
Ps: I already changed the allow_php_templates to true in file Smarty.class.php. What I'm doing wrong? Is there another variable that I should set to true or something? Thanks.[img][/img] |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sat Sep 12, 2015 12:09 am Post subject: |
|
|
You should not use PHP in template code.
Is that so hard to understand?
Write a template function, if you absolutely must do it from Smarty side.
But in reality, you must have this information on hand before the page is sent to Smarty. |
|
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
|