我正在尝试将 Fotolia Api 与 Prestashop 1.6.0.9 集成。
我已经使用自定义选项卡制作了模块,但我不知道如何从模块文件夹中为该选项卡设置视图。很抱歉,但是“开发人员文档”很烂。我找不到任何可行的解决方案。
public function install() {
if (!parent::install()
|| !$this->registerHook('backOfficeHeader')
|| !$this->registerHook('header')
) return false;
$tab = new Tab();
$tab->class_name = 'AdminFotoliaSelector';
$tab->id_parent = 0;
$tab->module = $this->name;
$tab->name[(int)(Configuration::get('PS_LANG_DEFAULT'))] = 'Fotolia Selector';
$tab->add();
return true;
}
我在制作正确的控制器时遇到了很大的问题,现在我无法加载任何东西/我不知道该怎么做。
<?php
if (!defined('_PS_VERSION_'))
exit;
class AdminFotoliaSelectorController extends ModuleAdminController {
public $name;
public function __construct() {
$this->lang = (!isset($this->context->cookie) || !is_object($this->context->cookie)) ? intval(Configuration::get('PS_LANG_DEFAULT')) : intval($this->context->cookie->id_lang);
parent::__construct();
}
public function initContent() {
parent::initContent();
$this->renderForm();
}
public function renderForm() {
$path = _MODULE_DIR_."fotoliaselector";
$more = $this->module->display($path, 'views/templates/admin/fotoliaselector.tpl');
return $more.parent::renderForm();
}
当我尝试 die($more) 时,它给了我 .tpl 的内容,无论如何,当我在后台单击选项卡时,它仍然是空的。我有调试选项,编译,缓存关闭。
所以请启发我,我应该如何在那里展示任何东西?