随笔分类 - Yii2
摘要:可以在配置文件中增加一个 “beforeRequest” 事件: 参考资料:stack overflow
阅读全文
摘要:参考资料:http://www.bsourcecode.com/yiiframework2/how-to-create-custom-widget-in-yii2-0-framework/如何使用yii2框架自定义widget本教程教你如何自定义widget,widget是view中能被重用的代码块...
阅读全文
摘要:使用方法// scenario is set as a property$model = new User;$model->scenario = User::SCENARIO_SHOW;// scenario is set through configuration$model = new User...
阅读全文
摘要:Role Based Access Control (RBAC)——基于角色的权限控制permissione.g. creating posts, updating postsroleA role represents a collection of permissions (e.g. creati...
阅读全文
摘要:直接上代码:$db = Yii::$app->db;$transaction = $db->beginTransaction(); //开启事务try { // 更新member表 $db->createCommand()->update('member',[ 'level' ...
阅读全文

浙公网安备 33010602011771号