【发布时间】:2015-05-03 19:55:29
【问题描述】:
我想在任何页面中创建一个 Div,以便我可以在其上使用 Jquery
这是我的目录/控制器/模块/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>
但是当我在 Layouts 中打开它时,我的 DIV 没有出现。我做错了什么 ?我认为我的控制器无法正常工作...
【问题讨论】:
-
有同样的问题..
-
您使用的是什么 Opencart 版本?为什么
$this->render();在你的代码中被注释掉了?
标签: php jquery layout module opencart