мне нужно взаимодействует с .tpl файл в моем классе adminController, но когда я пытаюсь сделать это, появляется эта ошибкаЧто такое лучший prestashop-способ включения tpl в AdminController?
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}
для тестирования.
Возможно, я все ошибаюсь, и это не лучший способ сделать на моей собственной странице администратора.
он не работает мой друг ... но хорошие новости с вашим решением теперь показывают пустую страницу только, нет ошибки ... позвольте мне показать вам http://prnt.sc/dy8bp5 – manhattan
@manhattan [This] (http://stackoverflow.com/questions/40544689/render-helper-form-from-prestashop-admin -controller /) должен помочь вам в загрузке пользовательского tpl в контроллере администратора. – TheDrot
@manhattan Я внес изменения, попробуйте 'AdminRiddlePageController' вместо' RiddlePageController', не забудьте обновить таблицу 'tab' в БД – sarcom