【发布时间】:2017-01-20 17:28:27
【问题描述】:
我需要与我的 adminController 类中的 .tpl 文件进行交互,但是当我尝试这样做时,会出现此错误
致命错误:在第 48 行的 /home/USER/public_html/prestashop/modules/RiddleModule/controllers/admin/RiddlePage.php 中调用未定义的方法 RiddlePageController::getCacheId()
这是我的管理控制器代码:
class RiddlePageController extends AdminController {
public function __construct()
{
$this->html = '';
$this->display = 'view';
$this->meta_title = $this->l('metatitle');
$this->module = "RiddleModule";
parent::__construct();
}
public function initContent()
{
$this->postProcess();
$this->show_toolbar = true;
$this->display = 'view';
$this->meta_title = $this->l('Modulo');
parent::initContent();
}
public function initToolBarTitle()
{
$this->toolbar_title = $this->l('Titulo');
}
public function initToolBar()
{
return true;
}
public function renderView() {
$this->context->smarty->assign(
array(
'img1' => "http://www.free-3dmodels.com/image/Flowers-3D-Model-3662994d.png",
'img2' => "http://www.all3dmodel.com/Images/39.jpg"
)
);
// in return have error "getCacheId"
return $this->display(__FILE__, 'content.tpl', $this->getCacheId());
// return "<b>This works fine!!</b>";
}
我的 tpl 文件只有 {$img1} 和 {$img2} 用于测试。
也许我做错了,这不是在我自己的管理页面中制作的最佳方式。
【问题讨论】:
标签: php model-view-controller module prestashop prestashop-1.6