3
我想在anypage创建一个div,这样我可以在其上使用jQueryOpencart的 - 模块没有出现,当我选择它的布局
这是我的目录/控制器/模块/ test_products.php
class ControllerModuleTestProducts extends Controller {
public function index() {
$this->document->addScript('catalog/view/javascript/test.js');
$path = '/template/module/test_products.tpl';
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . $path)) {
$this->template = $this->config->get('config_template') . $path;
} else {
$this->template = 'default'.$path;
}
return $this->load->view($this->template, $data);
//$this->render();
}
}
这是我的目录/视图/主题/默认/模板/模块/ test_products.tpl
<div id="test-notification" class="abc"></div>
但是当我在布局中打开它时,我的DIV不出现。我做错了什么 ?我认为我的控制器不能正常工作...
也有同样的问题。 – 2015-03-17 18:11:38
您使用的是什么Opencart版本?为什么'$ this-> render();'在你的代码中被注释掉了? – 2015-03-20 10:04:04