2015-01-04 55 views
0

我有Yii2管理员,用户和管理员安装了Yii2。我的问题是我不知道如何创建规则,实际上我不知道如何定义类名。应在何处定义“类”?我怎样才能看到我有哪些类或添加类?Yii2创建规则的问题

enter image description here

非常感谢,

+0

[问题与Yii2规则创建]的可能重复(http://stackoverflow.com/questions/27652290/problems-with-yii2-rules-creation) – arogachev 2015-01-04 14:46:41

回答

0

,你会进入应该是子类的yii\rbac\Rule类。所以,为了制定规则,你需要提供这个子类的namespace。假设,如果子类的名称是TestRule并且此类的namespaceapp\test。然后你必须写下类名app\test\TestRule

而且你TestRule类必须像

namespace app\test; 

class TestRule extends yii\rbac\Rule{ 
... 
}