は私のadminControllerクラス内の.tplファイルと相互作用し、私はそれをしようとすると、このエラーが表示されますAdminControllerにtplを含めるにはどのような方法が適していますか?私は必要
Fatal error: Call to undefined method RiddlePageController::getCacheId() in /home/USER/public_html/prestashop/modules/RiddleModule/controllers/admin/RiddlePage.php on line 48
これは私の管理コントローラのコードです:
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}
しかありません。
私はすべて間違っているかもしれませんが、これは自分の管理ページで行う最良の方法ではありません。
それは私の友人が動作しません。この場合にはTPLファイルをロードすることは重要ではありません...しかし、良いニュースは、今、あなたのソリューションであり、空白ページを表示のみ、エラーはない...私はあなたを見せてみましょうhttp://prnt.sc/dy8bp5 – manhattan
@マンハッタン[This(http://stackoverflow.com/questions/40544689/render-helper-form-from-prestashop-admin -controller /)は管理コントローラにカスタムtplをロードする方法を助けます。 – TheDrot
@manhattan私は変更を加えて、 'RiddlePageController'の代わりに' AdminRiddlePageController'を試してみましたが、DBの 'tab'テーブルを更新するのを忘れないでください。 – sarcom