YII

PHP

YII2 RBAC ACF 学习记录

4
首先 使用迁移命令 创建RBAC所需要的四张表:http://www.yiiframework.com/doc-2.0/guide-security-authorization.html 1 yii migrate --migrationPath=@yii/rbac/migrationsyii migrate --migrationPath=@yii/rba...
赞 (0)阅读(70)
PHP

YII 三种增加属性的方法

直接在模型类中增加公开的属性 重写父类的 attributes 方法 使用 seter  geter方法 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 public $newfiled="";   public function attributes() { return...
赞 (0)阅读(51)
PHP

YII2 中三种数据提供者(DataProvider)的区别

YII使用指南 : http://www.yiiframework.com/doc-2.0/guide-output-data-providers.html ActiveDataProvider 用用 yii\db\Query 或者yii\db\ActiveQuery从数据库查询数据,并且以数组项的方式或者 ActiveRecord 实例例的方式返回 Sql...
赞 (0)阅读(74)