这是我的第一个问题。我为我的网上商店使用Opencart。为了看起来我正在设计我的页面的CSS,例如account_login.css。但我也想做维护页面。我已经制作了common_maintenance.css文件。但是当我测试我的网站时显示不正确。它只是显示http://www.mywebsite.com而不是http://www.mywebsite.com/index.php?route=common/maintenance。请有人能帮我解决这个问题吗?Opencart:CSS(基于路线维护)
<?php
class ControllerCommonMaintenance extends Controller {
public function index() {
if ($this->config->get('config_maintenance')) { $route = '';
if (isset($this->request->get['route'])) {
$part = explode('/', $this->request->get['route']);
if (isset($part[0])) {
$route .= $part[0];
} }
// Show site if logged in as admin $this->load->library('user');
$this->user = new User($this->registry);
if (($route != 'payment') && !$this->user->isLogged()) {
return $this->forward('common/maintenance/info'); }
}
}
public function info() {
$this->load->language('common/maintenance');
$this->document->setTitle($this->language->get('heading_title'));
$this->data['heading_title'] = $this->language->get('heading_title');
$this->document->breadcrumbs = array();
$this->document->breadcrumbs[] = array(
'text' => $this->language->get('text_maintenance'), 'href' => $this->url->link('common/maintenance'),
'separator' => false
);
$this->data['message'] = $this->language->get('text_message');
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') .
'/template/common/maintenance.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/maintenance.tpl';
} else {
$this->template = 'default/template/common/maintenance.tpl'; }
$this->children = array( 'common/footer', 'common/header' );
$this->response->setOutput($this->render());
} } ?>
您是否配置了URL重写? – 2012-03-07 18:55:16
你是如何改变css的?这需要更多的信息 – 2012-03-07 20:00:47
这些页面在catalog/controller/common/header.php中加载了自己的CSS,并在这个代码后面,在行保护函数index()之后(换行):$ route = empty($ this-> request - > get ['route'])? 'common/home':$ this-> request-> get ['route']; $ css_file = str_replace('/','_',$ route)。 ”的CSS; (file_exists(DIR_TEMPLATE。$ this-> config-> get('config_template')。'/ stylesheet /'。$ css_file)){this-> document-> addStyle('catalog/view/theme/'。$ this-> config-> get('config_template')。'/ stylesheet /'。$ css_file); } @JayGilford – coen1234 2012-03-08 08:22:47