我在opencart 1.5.x上有一个完美的扩展
现在使用opencart 2.0,我已经从这里读到了Adding an admin page on OpenCart version 2所做的更改" shadyyx"只有少数输入可以保存,而其他输入则不会。
示例:
控制器(未完成):
$this->load->model('setting/setting');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('advanced_stock_notification', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'));
}
if (isset($this->request->post['notify_mode'])) {
$data['notify_mode'] = $this->request->post['notify_mode'];
} else {
$data['notify_mode'] = $this->config->get('notify_mode');
}
模板(未完成)
<input name="notify_mode" id="notify_mode" value="<?php echo $notify_mode; ?>" />
形式:
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">