我有这个错误
“注意:未定义的变量:登录C:\ WAMP \ WWW \ SITE \ TOOLS \ SMARTY \ SYSPLUGINS \ SMARTY_INTERNAL_DATA.PHP在线291 CALL STACK”
这是我的PHP代码
function hookFooter($params)
{
global $smarty;
$smarty->assign('ENT_QUOTES', ENT_QUOTES);
if( file_exists('modules/ebbrandingfooter/logo-footer.jpg')){
$smarty->assign('logo','modules/ebbrandingfooter/logo-footer.jpg');
};
$FOOTERdescription=Configuration::get('FOOTER_DESC');
$smarty->assign('description',$FOOTERdescription );
return $this->display(__FILE__, 'ebbrandingfooter.tpl');
}
这里是TPL
{if $logo}<img src="{$logo}" />{/if}
<p>{$description}</p>
任何人都可以帮助我,我做错了吗? THX !!!
答案 0 :(得分:3)
您可以修改PHP代码以确保设置$ logo,例如:
function hookFooter($params)
{
global $smarty;
$smarty->assign('ENT_QUOTES', ENT_QUOTES);
if( file_exists('modules/ebbrandingfooter/logo-footer.jpg')){
$smarty->assign('logo','modules/ebbrandingfooter/logo-footer.jpg');
} else {
$smarty->assign('logo', null);
}
$FOOTERdescription=Configuration::get('FOOTER_DESC');
$smarty->assign('description',$FOOTERdescription );
return $this->display(__FILE__, 'ebbrandingfooter.tpl');
}
另请注意,在}
后,您不需要分号。