wxk843
规则表:[auth_rule]
一个用户要执行一个操作除了要看他有没有这个权限外,还要看他的这个权限能不能执行。
在上面的 表:auth_item 中还有一个字段: [rule_name] 。这个字段用来标明这个角色或者权限能不能成功执行。
那么规则这个表里面的数据是从哪里来的呢?
下面这个是规则的基类:abstract class Rule extends Object
{/** * @var string name of the rule */ public $name; /** * @var integer UNIX timestamp representing the rule creation time */ public $createdAt; /** * @var integer UNIX timestamp representing the rule updating time */ public $updatedAt; /** * Executes the rule. * * @param Item $item the auth item that this rule is associated with * @param array $params parameters passed to [[ManagerInterface::allow()]]. * @return boolean a value indicating whether the rule permits the auth item it is associated with. */ abstract public function execute($item, $params);
}
$name 为规则的名称。
也就是说如果要在 规则表:[auth_rule] 中增加一条规则就得要有对应的规则类,并实现方法 abstract public function execute($item, $params) 具体的逻辑来判定$item(角色或者权限)是否可执行。- wxk843 赞了回答
$_SESSION Name Value __flash [] __returnUrl '/unionpay/admin288.php' __id 6
这个__id就是用户id
你用Yii Debugger看看 - wxk843 评论了教程 yii2-imagine配置
如何在 yii2 使用Imagick ,我已安装好, 使用Imagick时, Imagick的函数都不能用了,还是我引入的错误了
如:$animation = new \Imagine\Imagick\Imagine();//设置生成的格式 $animation->setFormat('gif');
提示没有setFormat方法
- wxk843 发表了说说yii2 使用Imagick怎么用?Imagick的好多函数都没法用了
- wxk843 评论了教程 yii2集成smarty
集成不成功,有那么朋友有遇到
PHP Fatal Error – yii\base\ErrorException
Class 'Smarty' not found