<?php
//创建Registry对象
//注册所有公共类
//创建Front类对象,作为请求分发器(Dispatcher)
//根据用户请求(url)创建控制器对象及其动作。
// 在Front类私有函数execute($action)中如下语句
// $controller = new $class($this->registry); //创建控制器
//控制器加载相应的模型,如
// $this->load->model('design/layout');(注意前后的模型,/ 线前面是模型下的文件目录名后面是目录下的文件名,也是模型对象)
// 该语句将创建相应的model对象。(相当NEW对像,加载进模型后就可以使用了,一般处理复杂程序或需要重用时就会建模型,每个模型是一个类)
//如:
//$this->load->model('user/user');//加载后模型类名$this->文件目录->文件名(文件目录是指model下的目录名)
//$this->model_user_user->getTotalUsersByEmail($this->request->post['email'])
//控制器获取模板,绘制(提取数据并启用output buffer)到页面输出区output中
// $this->render();
//(7)最后Response对象把输出区的数据(页面)echo返回给用户 $this->language->load('account/address');
$this->load->model('account/address');
$this->session->data['redirect']
$this->document->setTitle($this->language->get('heading_title'));
?>

语言包类型:
    header    标题类        $_['heading_title']  = '欢迎来到商店后台管理系统';
    Text    文本类        $_['text_heading']   = '管理员登录系统,闲人免入!';
    Entry    实体        $_['entry_username'] = '管理员:';
    Button    按钮        $_['button_login']   = '登录';
    Error    错误信息    $_['error_login']    = '请输入有效的用户名和密码!';

====================================================================
user:一般指的是后台用户,操作员
$this->data['action'] = $this->url->link('common/login', '', 'SSL');
$this->data['redirect'] = $this->url->link($route, $url, 'SSL');
====================================================================
$this->load->
$this->config->
$this->db->
$this->url->
$tihs->log->
$this->request->
$this->response->
$this->cache->
$this->session->
$this->language->
$this->document->
$this->currency->
$this->weight->
$this->length->
$this->user->

常用方法
    validate

和店铺id关联的有:[多店铺管理]
    类别、产品、品牌、信息页

opencart默认缓存的数据
1、country        国家
2、currency        币种
3、get_zone        地区
4、language        语言
5、length_class        长度
6、order_status        订单状态
7、return_action     退货
8、tax_class        税收
9、weight_class        重量

邮件发送方法调用:

$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->request->post['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
<?php
$this->document->setTitle($product_info['name']);//设置页面标题
$this->document->setDescription($product_info['meta_description']);//设置页面描述
$this->document->setKeywords($product_info['meta_keyword']);//设置页面关键字
$this->document->addLink($this->url->link('product/product', 'product_id=' . $this->request->get['product_id']), 'canonical');
$this->document->addScript('catalog/view/javascript/jquery/tabs.js');
$this->document->addScript('catalog/view/javascript/jquery/colorbox/jquery.colorbox-min.js');
$this->document->addStyle('catalog/view/javascript/jquery/colorbox/colorbox.css');

opencar二次开发常用代码的更多相关文章

  1. 23个phpcms v9模板制作及二次开发常用代码案例

    0:调用最新文章,带所在版块 {pc:get sql="SELECT a.title, a.catid, b.catid, b.catname, a.url as turl ,b.url a ...

  2. PHPCMS V9 二次开发常用代码集

    0:调用最新文章,带所在版块 {pc:get sql="SELECT a.title, a.catid, b.catid, b.catname, a.url as turl ,b.url a ...

  3. ecshop二次开发常用代码

    通过index控制循环次数.在循环中将index作为if的判断条件,对循环进行控制.这里index是从0开始的.如果index<2,会进行两次循环. <!--{foreach from=$ ...

  4. destoon二次开发基础代码

    标签调用规则 http://help.destoon.com/develop/22.html 数据字典 http://help.destoon.com/dict.php destoon各类调用汇总 h ...

  5. SkylineDemoForWeb JavaScript二次开发示例代码

    SkylineDemoForWeb JavaScript二次开发示例代码 http://files.cnblogs.com/files/yitianhe/SkylineDemoForWeb.zip

  6. 36个Android开发常用代码片段

    //36个Android开发常用代码片段 //拨打电话 public static void call(Context context, String phoneNumber) { context.s ...

  7. 56个PHP开发常用代码

    2016/02/14 6203 4    在编写代码的时候有个神奇的工具总是好的!下面这里收集了 50+ PHP 代码片段,可以帮助你开发 PHP 项目. 这些 PHP 片段对于 PHP 初学者也非常 ...

  8. iOS开发常用代码块(第二弹)

    GCD定时器 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, ); dispat ...

  9. iOS开发常用代码块

    遍历可变数组的同时删除数组元素 NSMutableArray *copyArray = [NSMutableArray arrayWithArray:array]; NSString *str1 = ...

随机推荐

  1. jsp的url后跟中文参数传参出现乱码

    ①重新编码:String urlParam= request.getParameter("urlParam");  urlParam= new String(urlParam.ge ...

  2. Bitmap介绍

    转自:http://blog.csdn.net/xgdofull/article/details/5424611 简单的说就是用数组存放若有数据就标志为1或true,若不存在标志为0或false.比如 ...

  3. 【HDOJ】2782 The Worm Turns

    DFS. /* 2782 */ #include <iostream> #include <queue> #include <cstdio> #include &l ...

  4. BZOJ3039: 玉蟾宫&wikioi2491 玉蟾宫

    3039: 玉蟾宫 Time Limit: 2 Sec  Memory Limit: 128 MBSubmit: 430  Solved: 265[Submit][Status] Descriptio ...

  5. 搜索(剪枝优化):HDU 5113 Black And White

    Description In mathematics, the four color theorem, or the four color map theorem, states that, give ...

  6. C# 导出 Excel 数字列出现‘0’的解决办法

    在DataGird的中某一列全是数字并且长度大于15的字符,在导出excel时数字列第15-18位全部为0. 解决办法:在需导出数字列前加入英文字符状态的单引号(‘ ), 如: <asp:Tem ...

  7. Rails 看起来很不错哦。

    最新在工作中遇上了ruby,确切的说是rails. 其实我的工作是一个渗透测试工程师(其实就是拿着一堆黑客工具扫描的活).   而我不怎么了解ruby on rails.但是客户即将上线的商城系统是用 ...

  8. HDU 3555 Bomb(数位DP)

    Bomb Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Subm ...

  9. 折腾iPhone的生活——iPhone 5s 开启 assistive touch 后卡顿的问题

    刚刚入手我的国行iPhone5s土狗灰,感觉倍棒~ 但是一上手就发现了一个问题:卡顿. 卡顿不仅体现在日常使用中,游戏中更加严重,当我玩水果忍者的时候,会发现切水果的画面都变得不流畅起来,这是拥有64 ...

  10. SPI,UART,I2C都有什么区别,及其各自的特点

    区别: SPI:高速同步串行口.3-4线接口,收发独立.可同步进行 UART:通用异步串行口.按照标准波特率完成双向通讯,速度慢 I2C:一种串行传输方式,三线制,网上可找到其通信协议和用法的 3根线 ...