- 博客(12)
- 收藏
- 关注
转载 在小程序框架wepy中使用静态方法,method can be static
在wepy中有些method可以被写成静态的,当调用此方法的时候用class名直接调用就可以,比如Play.login (形如class.method) 转载于:https://my.o...
2019-02-27 10:27:00
354
转载 Yii2: DataProvider的数据缓存问题。
我们在使用DataProvider的时候,只有调用了其Provider::getModels()才会返回实际的数据,如果要对数据进行缓存,应该在Controller::afterAction()中操作。另外,在yii\rest\Controller中,是通过在afterAction中调用 y...
2018-03-13 10:50:00
244
转载 关于XmlPraser,xml格式的解析问题。
微信支付的接口大部分用的是xml格式,当Yii2接收一组post过来的xml数据时,需要用到XmlParser进行解析,设置方式 Yii::$app->request->prasers = ['text/xml' => 'light\yii2\XmlParser','a...
2018-01-24 18:18:00
126
转载 七牛云:如何获取图片的定宽版本,高度等比缩放。
参考文档 https://developer.qiniu.com/dora/manual/1279/basic-processing-images-imageview2 转载于:http...
2017-11-22 15:42:00
2772
转载 Yii2:关于DbAuthManager::checkAccess()的一个时序图。
转载于:https://my.oschina.net/u/3012487/blog/832551
2017-02-06 16:46:00
242
转载 Yii2: 关于单一入口问题(.htaccess rewrite)
之前遇到一个问题,就是设置Apache虚拟主机时,frontend总是只认一个index页面,其他都是not found,调整了urlManager ,添加了.htaccess都不行。各种谷歌后,发现了问题所在,需要在http.conf中添加 <Directory "/usr/loca...
2017-01-21 19:06:00
216
转载 Yii2: 关于如何使用postman发送基于Bearer的authrization.
1,在postman中选择验证方式为no auth. 2,添加header,key为:Authorization,value为Bearer xxxxxxxxxxxxx. 注意:key的拼写必须一样(包括大小写),value中的Bearer和xxxxxxxx之间至少要有一个空格,...
2017-01-13 09:45:00
708
转载 Yii2: $this->user ?: Yii::$app->getUser(),三元操作符
在php5.3之后,三元操作符可以将第二项省略. //如果$this->user为真返回$this->user,为假发挥Yii::$app->getUser().$this->user ?: Yii::$app->getUser(); ...
2017-01-10 10:30:00
738
转载 yii2: 用kartik写了一天的图片上传。
用Kartik写了一天的图片上传,单个图片可以,多张图片总是不行,搞了一天啊。靠到了晚上才发现原来是php.ini里面的post_max_size = 3M的问题,靠。 转载于:https...
2017-01-04 23:01:00
114
转载 第二种办法:Yii2中关联数据表数据在gridview中的显示,查询(search)和排序(sort)等。...
https://www.youtube.com/watch?v=Fw6k3BEsCCE 转载于:https://my.oschina.net/u/3012487/blog/785610...
2016-11-10 13:32:00
367
转载 Yii2中关联数据表数据在gridview中的显示,查询(search)和排序(sort)等。
在数据库中有三张表,branch(分店),branch_product(店铺与其产品的关联关系表),product(产品信息表)。 1,在BranchProductSearch模型(扩展自BranchProduct)中添加一个新的属性 public $productName 2,在Bra...
2016-11-10 10:12:00
431
转载 hello world
hello world <?phpecho 'hello world';?> 转载于:https://my.oschina.net/u/3012487/blog/7...
2016-11-03 23:37:00
75
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人