Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Problem with $allow_php_tag after smarty update

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Saeid
Smarty Rookie


Joined: 21 Jun 2010
Posts: 25

PostPosted: Tue Jan 22, 2013 9:17 am    Post subject: Problem with $allow_php_tag after smarty update Reply with quote

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
View user's profile Send private message Visit poster's website
mohrt
Administrator


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

PostPosted: Tue Jan 22, 2013 2:23 pm    Post subject: Reply with quote

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


Joined: 21 Jun 2010
Posts: 25

PostPosted: Tue Jan 22, 2013 9:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General 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