KillMeAgain
为什么要
andFilterWhere
,直接where
不行吗?- KillMeAgain 赞了回答
Yii::$app->db->getLastInsertID()
- KillMeAgain 2015-12-07 已签到连续签到1天,获得了5个金钱
- KillMeAgain 2015-12-04 已签到连续签到1天,获得了5个金钱
- KillMeAgain 赞了回答
1, $id, $module这2个值谁传进来的 ?
是
Module
传进来的;Module
通过路由
orcontrollerMap
得到controller
的Id
, 再把自身传进来, 就实例化出controller
了;2, 基础版中,没有模块,
getModules()
方法为什么运行进来,什么时候调用的 ?首先 基础版中, 是有模块的, 并且可以嵌套多层;
Yii
本身就是建立在Module
的基础上,Yii::$app
也是一个Module
.至于什么时候调用,
在框架中, 触发
controller
中的beforeAction
和afterAction
事件时, 会调用祖宗Module
执行相应的事件.对于开发者来说, 你通过
controller
调用getModules
方法 , 或者 访问controller
的modules
属性时候 就调用了 - KillMeAgain 赞了回答
写错了!!!!
- KillMeAgain 回答了问题 Controller.php源码
写错了!!!!
- KillMeAgain 2015-11-30 已签到连续签到1天,获得了5个金钱
- KillMeAgain 回复了 KillMeAgain 的回答
Body
x-www-form-urlencodedusername=test123 email=test123@qq.com password=1234567
@cgp 互相帮助
- KillMeAgain 回复了 KillMeAgain 的回答
Body
x-www-form-urlencodedusername=test123 email=test123@qq.com password=1234567
这个需要看你common\models\User里面的rules方法的配置,看你前面的sql保存,就是报的有重复空的username