English 中文(简体)
我的婚姻关系不为人所知,但它是一个法律方面。
原标题:my smarty got unknown tag , but it is a legal tag

currently i change smarty 2 -> version 3

但经过一番改动后,问题如下。

SmartyCompilerException: Syntax Error in template 
"/home/test/engine/mobile9/template/t_footer.tpl" on line 28 
"{php}" unknown tag "php" in /home/test/engine/modules/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 617

after that i check smarty 3 documentations. it shown {php} is valid operator.

问题回答

查阅文件here:

IMPORTANT NOTICE

{php} tags are deprecated from Smarty, and should not be used. Put your PHP logic in PHP scripts or plugin functions instead. Note

As of Smarty 3.1 the {php} tags are only available from SmartyBC.

If you re using Smarty 3.0x, it should work. If you re using Smarty 3.1, you have to install the SmartyBC class (Backwards Compatibility Wrapper) for the use of the {php}-Tag.

但是,如果可能的话,试图遵循聪明建议: PHP 字体中的Put PHP逻辑,而不是智能模板。





相关问题
Smarty: how to evaluate string as a variable

Variable assigned in my template is {$testVariable_123}, where 123 is auto generated and is also assigned to template as {$autoValue} So in my template I want to get value of above variable. {assign ...

How to add an element To Array

Hmm.. thats realy different problem I fetch $links from db linke this $links = $db->GetAll("SELECT * FROM {$tables[ link ][ name ]} WHERE STATUS = 2 AND CATEGORY_ID = ".$db->qstr($id)." {$...

What are .tpl files? PHP, web design

Someone wants me to redesign a site run in PHP (VideoCMS). But when I asked him to send me the source he has given me *.tpl files instead of *.php. There is some code inside them: {include file= ...

Smarty Concatenation

Hi I am trying to do concatenation in smarty. Here is an example of how I would like to use the code. The php assigns $smarty->assign( myvar ,array(1,5,6,4)); $smarty->assign( myvar2 ,array( a1 ...

Smarty is very slow sometimes

We use Smarty and time to time it really takes a lot of time for it to render a template. Normally it works fine, but sometimes (like 1 random pageview out of 1 000) it takes about 5 seconds to render ...

Smarty Section Making the selected Link Bold

How can I make the selected link from the List below, bold, that you see you are on Page ex. 3 or 5 With this code, If you click on a Link you don t know on which page you are. The smarty code ...

how to pass embed code in javascript

<a href="" onClick="return select_item(<embed src="player.swf" allowfullscreen="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="id=&flv=...

热门标签