我已经为Opencart创建了非常简单的模块,只是在管理面板中显示hello world。这是我的控制器:
<?php
class ControllerExtensionModuleHelloworld extends Controller {
public function index(){
$this->load->language('/extension/module/helloworld');
$this->document->setTitle('Hello World');
$data['heading_title'] = $this->language->get('heading_title');
$data['helloworld'] = $this->language->get('helloworld');
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/module/helloworld', $data));
}
}这是我的观点:
{{header}}
<div class="container">
<div class="row>
<div class="col">
{{column_left}}
</div>
<div class="col">
<h1>{{heading_title}}</h1>
<p>{{helloworld}}</p>
</div>
</div>
</div>
{{footer}}问题是h1和p标记显示在列的左侧,如下所示:

我使用col sm-4和col sm-8更改了col类,如下所示:
{{header}}
<div class="container">
<div class="row>
<div class="col-sm-3">
{{column_left}}
</div>
<div class="col-sm-8">
<h1>{{heading_title}}</h1>
<p>{{helloworld}}</p>
</div>
</div>
</div>
{{footer}}但这并不起作用,最后我将col sm-offset-2类添加到了col sm-8 div中,它将文本左移,就像它应该做的那样。你知道问题出在哪里吗?
发布于 2017-08-21 17:46:09
{{ header }} {{column_left}}
<div id="content">
<div class="page-header">
<div class="container-fluid">
<h1>{{ heading_title }}</h1>
</div>
</div>
<div class="container-fluid">
<!-- content here -->
</div>
</div>
{{ footer }}试试这个,应该行得通。
https://stackoverflow.com/questions/45793875
复制相似问题