|
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 |
Saeid Smarty Rookie
Joined: 21 Jun 2010 Posts: 25
|
Posted: Tue Jan 22, 2013 9:17 am Post subject: Problem with $allow_php_tag after smarty update |
|
|
Hi all,
I decided to update to the newest version of Smarty from an older version (version 2.x I was using). Now I am getting this error:
Code: |
Undefined property: Smarty::$allow_php_tag
|
Clearly in some of my templates I am using php code, so is it that php is not allowed in new version, or the variable name has changed? any ways to fix this issue?
This is the part of code I think caused the problem (this is the only time I am using php inside template:
Code: |
<div id="categories">
<div id="leftBlockTitle">Categories</div>
{php}
global $smarty;
include SITE_ROOT_PATH."/categories/functions/categories.list.php";
$smarty->assign('categories', getCategories());
{/php}
{include file="{$smarty.const.THEME_URL}/articles/blocks/articlesCatBlockLeft.tpl" list=$categories}
</div> |
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Jan 22, 2013 2:23 pm Post subject: |
|
|
If you want {php} tags you have to use the SmartyBC class. This is all outlined in the upgrade notes that ship with Smarty. |
|
Back to top |
|
Saeid Smarty Rookie
Joined: 21 Jun 2010 Posts: 25
|
Posted: Tue Jan 22, 2013 9:41 pm Post subject: |
|
|
mohrt wrote: | If you want {php} tags you have to use the SmartyBC class. This is all outlined in the upgrade notes that ship with Smarty. |
Well I did that too:
Code: |
include(SITE_ROOT_PATH.'/include/smarty/libs/SmartyBC.class.php');
$smarty = new SmartyBC;
|
I still get the same error but this time with SmartyBC :
Code: | Undefined property: SmartyBC::$allow_php_tag |
UPDATE:
ok I had to remove allow_php_tag = true but I ran into other problems that I fix later. |
|
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
|