簡體   English   中英

我想為Smarty .tpl文件編寫PHP代碼

[英]I want to write PHP code for a Smarty .tpl file

我想為Smarty .tpl文件編寫PHP代碼。 但這給了我以下錯誤:

沒捉到-> Smarty編譯器:第185行“ {php}”未知標簽“ php” <-中的模板“ ./templates/register.tpl”中的語法錯誤<-拋出/ opt / lampp / htdocs / Smarty / libs / sysplugins /smarty_internal_templatecompilerbase.php在第185行

當我使用Google時,我意識到它已被棄用,不建議使用。 我現在應該怎么辦? 我想顯示帶有安全性問題的下拉菜單。

不知道Smary是什么或如何使用,但我從文檔中得到的是{php}已過時。

http://www.smarty.net/docs/en/language.function.php.tpl

回傳{$foo} tpl文件中的$ foo變量

您應該在smarty_securoty.php中進行更改,並進行

public $ allow_php_tag = false;

public $ allow_php_tag = true;

它允許.tpl文件中的PHP代碼

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM