下面介绍一下 Yii2.0 对数据库 查询的一些简单的操作 User::find()->all(); 此方法返回所有数据; User::findOne($id); 此方法返回 主键 id=1 的一条数据(举个例子); User::find()->where(['name' => '小伙儿'])->o... ...
分类:
数据库 时间:
2016-06-14 11:51:54
阅读次数:
190
required : 必须值验证属性 email : 邮箱验证 match : 正则验证 url : 网址 captcha : 验证码 safe : 安全 compare : 比较 default : 默认值 exist : 存在 file : 文件 filter : 滤镜 in : 范围 uniq ...
分类:
其他好文 时间:
2016-06-13 13:16:56
阅读次数:
114
yii2框架官方说明文档 http://www.yiiframework.com/doc/guide/2.0/zh_cn/caching.page yii2创建您的第一个application应用 http://www.yiiframework.com/doc/guide/2.0/zh_cn/qui ...
分类:
其他好文 时间:
2016-06-12 18:34:32
阅读次数:
207
Module类是模块和应用类的基类。 yiisoft\yii2\base\Module.php ...
分类:
其他好文 时间:
2016-06-08 21:39:49
阅读次数:
149
(一) 原文地址:http://www.yii-china.com/post/detail/1.html (二) 原文地址:http://www.yii-china.com/post/detail/2.html (三) 原文地址:http://www.yii-china.com/post/detai ...
分类:
其他好文 时间:
2016-06-08 18:56:40
阅读次数:
198
比如要添加 https://github.com/2amigos/yii2-qrcode-helper 生成二维码的 这个扩展第一种方法 : 1、打开根目录的composer.json, 在require那里加上 "2amigos/yii2-qrcode-helper" : "~1.0",如图 "r ...
分类:
其他好文 时间:
2016-06-08 12:29:45
阅读次数:
283
先上图看效果,样式虽然有点丑,这都不重要,我相信拿到代码的你们更注重的是这功能怎么实现的! 从上图中不难看出,我们制定跳转到某页的功能是基于linkpager之上的扩展,这根我们之前实现的分页扩展明显不同,之前的明显就是重写了!当然,这都不重要,我们看看GoLinkPager的具体实现!名字起的有点 ...
分类:
其他好文 时间:
2016-06-08 09:08:49
阅读次数:
277
模型类DynamicModel主要用于实现模型内的数据验证yii2\base\DynamicModel.php ...
分类:
其他好文 时间:
2016-06-07 22:06:13
阅读次数:
234