opencart.com (部分内容似乎被墙了)
$this->response->setOutput($this->load->view('common/login.tpl',$data)); // 或者是 return $this->load->view('common/login.tpl',$data);
<?php return new Action('common/login'); ?>
$this->load->language('common/login'); // 翻译模块 $this->language->get('button_upload'); // 获取翻译文字 $this->request->get['dictory']; // 请求参数 $this->request->files['file']['name'] // 上传文件 $this->request->server('HTTPS'); // 访问$_SERVER $this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
$this->response->redirect($this->url->link('common/login', '', 'SSL')); // 输出重定向
$this->load->model('tool/image'); // 导入模型层
$this->model_tool_image->method(); // 访问模型层 $this->session->data['token']; // 访问会话数据 $this->url->link('report/customer_online', 'token=' . $this->session->data['token'], 'SSL'); // 链接 $this->config->get('config_name'); // 访问配置文件 $this->user->getUserName(); // 用户模块 $this->document->getKeyWords(); // 文档模块
$pagination = new Pagination(); // 分页数据 $pagination->total = $image_total; // 记录数量 $pagination->page = $page; // 当前页 $pagination->limit = 16; // 单页记录 $pagination->url = $this->url->link('common/filemanager', 'token=' . $this->session->data['token'] . $url . '&page={page}', 'SSL'); // 分页链接 $data['pagination'] = $pagination->render(); // 渲染分页代码
<?php // 在别处引用通用控制器模块。
// 以下摘自controller/account/login.php。
// 这里的controller所做的事情:计算变量,翻译模板,保存部分html。
// 在view/theme/mytemplatename/template/account/login.tpl文件中引用这些变量:
// <?php echo $header; ?>, <?php echo $footer; ?> ...
$data['column_left'] = $this->load->controller('common/column_left'); $data['column_right'] = $this->load->controller('common/column_right'); $data['content_top'] = $this->load->controller('common/content_top'); $data['content_bottom'] = $this->load->controller('common/content_bottom'); $data['footer'] = $this->load->controller('common/footer'); $data['header'] = $this->load->controller('common/header'); ?>
1 注册 http://host/index.php?route=account/register 2 登录 http://host/index.php?route=account/login 3 忘记 http://host/index.php?route=account/forgotten 4 会员 http://host/index.php?route=account/account
<?php // 摘自 controller/account/register.php $this->document->addScript('catalog/view/javascript/jquery/datetimepicker/moment.js'); $this->document->addScript('catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js'); $this->document->addStyle('catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css'); ?>