[英]Smarty variables not working
因此,我很確定我是根據smarty文檔正確執行此操作的,但是我似乎什至無法獲得一個簡單的變量即可正常工作,這是我的代碼
{extends file="master.tpl"}
{block name=body}
div id="LeftPanel">
<div>
{$image}
</div>
{/block}
背后的代碼
$smarty->assign('$image'," ");
if($voFrontPage != null && $voFrontPage->Image_ID) {
$sImage = "<a href='ViewEvent.php?EventID={$voFrontPage->Event_ID}' class='ImgLink'>";
$sImage .= "<img alt='{$voEvent->Title}' class='center' src='Includes/Objects/ImageHandler.php?ImageID={$voFrontPage->Image_ID}' title='{$voEvent->Title}' class='ui-corner-all'/></a>";
$smarty->assign('$image',$sImage);
}
嘗試使用此方法時收到以下錯誤...我真的不明白我在做什么錯。
SmartyCompilerException:語法錯誤第627行/ home / masc / www / Includes / 3rdPartyLibs / smarty / sysplugins / smarty_internal_templatecom上第4行“ {$ image}”未知標簽“ private_print_expression”中的模板“ templates / index.tpl”
好的,我知道了,這是一個損壞的聰明安裝,顯然不是所有上傳到服務器的文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.