opencar二次开发常用代码
<?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二次开发常用代码的更多相关文章
- 23个phpcms v9模板制作及二次开发常用代码案例
0:调用最新文章,带所在版块 {pc:get sql="SELECT a.title, a.catid, b.catid, b.catname, a.url as turl ,b.url a ...
- PHPCMS V9 二次开发常用代码集
0:调用最新文章,带所在版块 {pc:get sql="SELECT a.title, a.catid, b.catid, b.catname, a.url as turl ,b.url a ...
- ecshop二次开发常用代码
通过index控制循环次数.在循环中将index作为if的判断条件,对循环进行控制.这里index是从0开始的.如果index<2,会进行两次循环. <!--{foreach from=$ ...
- destoon二次开发基础代码
标签调用规则 http://help.destoon.com/develop/22.html 数据字典 http://help.destoon.com/dict.php destoon各类调用汇总 h ...
- SkylineDemoForWeb JavaScript二次开发示例代码
SkylineDemoForWeb JavaScript二次开发示例代码 http://files.cnblogs.com/files/yitianhe/SkylineDemoForWeb.zip
- 36个Android开发常用代码片段
//36个Android开发常用代码片段 //拨打电话 public static void call(Context context, String phoneNumber) { context.s ...
- 56个PHP开发常用代码
2016/02/14 6203 4 在编写代码的时候有个神奇的工具总是好的!下面这里收集了 50+ PHP 代码片段,可以帮助你开发 PHP 项目. 这些 PHP 片段对于 PHP 初学者也非常 ...
- iOS开发常用代码块(第二弹)
GCD定时器 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, ); dispat ...
- iOS开发常用代码块
遍历可变数组的同时删除数组元素 NSMutableArray *copyArray = [NSMutableArray arrayWithArray:array]; NSString *str1 = ...
随机推荐
- h.264并行解码算法2D-Wave实现(基于多核共享内存系统)
cache-coherent shared-memory system 我们最平常使用的很多x86.arm芯片都属于多核共享内存系统,这种系统表现为多个核心能直接对同一内存进行读写访问.尽管内存的存取 ...
- bzoj2326
首先不难得出递推式f[i]=(f[i-1]*10^k+i) mod m;f[i]表示接到第i个数时的余数,k表示i的位数不难想到先按位数穷举位数,然后对于确定的位数,构造矩阵解决易得出:f[i] ...
- PuTTY DSA签名远程缓冲区溢出漏洞(CVE-2013-4207)
漏洞版本: Simon Tatham PuTTY 0.52 - 0.63 漏洞描述: BUGTRAQ ID: 61649 CVE(CAN) ID: CVE-2013-4207 PuTTY是Window ...
- page-object使用(2)---elements
elements就是html元素下所有的标签.用page-object你可以找到并定位html页面下绝大多数的元素,这个文章列出了可定位的这些元素,生成的方法,和依据什么关键字来找到这些元素. BUT ...
- Eclipse中svn图标不显示
在菜单栏中:windows ->preferences->General->Appearance->Lable Decorations 勾选其中的 SVN 项,最后应用确认之后 ...
- MRTG开源监控安装手册
环境要求: CentOS6以上版本 2G内存 16G存储 源码包下载:第一部分:下载,第二部分:下载 1.安装snmp: yum install -y net-snmp net-snmp-devel ...
- debian添加sudo
debian安装好默认没有sudo,都要su到root,感觉很容易手抖打错命令. 于是通过 apt-get install sudo安装sudo 然后就是添加有权限的用户到 /etc/sudoers ...
- python 2 处理HTTP 请求的包
httplib httplib: https://docs.python.org/2/library/httplib.html python 的官方文档这样说明: This module define ...
- memcached与redis 对比
一. 综述 读一个软件的源码,首先要弄懂软件是用作干什么的,那memcached和redis是干啥的?众所周知,数据一般会放在数据库中,但是查询数据会相对比较慢,特别是用户很多时,频繁的查询,需要耗费 ...
- 【Android - MD】之CardView的使用
CardView是Android 5.0新特性--Material Design中的一个布局控件,可以通过属性设置显示一个圆角的类似卡片的视图. 1.CardView的属性: app:cardCorn ...