在Smarty模板中从模板中包含的PHP文件分配数据时,我遇到了麻烦。我正在使用最新版本的smartyBC。这是代码:
index.php:
require_once 'include/ui.class.php';
$ui = new ui;
$data = $ui->smarty->assign('title',"INDEX WEB PAGE");
index.tpl:
{include_php 'index.php'}
{$title}
它无法识别$ title并返回此消息通知:未定义索引:$ title