本文整理汇总了PHP中yii\base\ActionFilter::init方法的典型用法代码示例。如果您正苦于以下问题:PHP ActionFilter::init方法的具体用法?PHP ActionFilter::init怎么用?PHP ActionFilter::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\base\ActionFilter
的用法示例。
在下文中一共展示了ActionFilter::init方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* 初始化方法
*/
public function init()
{
parent::init();
//获取user实例
$this->user = Instance::ensure($this->user, User::className());
$this->user_info = $this->user->identity;
}
示例2: init
public function init()
{
parent::init();
if ($this->allowActions && $this->denyActions) {
throw new \yii\base\InvalidConfigException("allowActions and denyActions only one can be set");
}
}
示例3: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
if ($this->view === null) {
$this->view = Yii::$app->getView();
}
}
示例4: init
/**
* Initializes the [[rules]] array by instantiating rule objects from configurations.
*/
public function init()
{
parent::init();
$this->user = Instance::ensure($this->user, User::className());
if ($this->user->identity !== null) {
$this->user->identity->getRules();
}
}
示例5: init
/**
* Initializes the [[rules]] array by instantiating rule objects from configurations.
*/
public function init()
{
parent::init();
foreach ($this->rules as $i => $rule) {
if (is_array($rule)) {
$this->rules[$i] = Yii::createObject(array_merge($this->ruleConfig, $rule));
}
}
}
示例6: init
public function init()
{
/** @var $module Module */
if (empty($this->user) && ($module = Yii::$app->getModule('admin')) != null) {
$this->user = $module->adminComponent;
}
ActionFilter::init();
if (empty($this->rules)) {
$this->rules = [['actions' => [], 'allow' => true, 'roles' => ['@']]];
}
$this->user = Instance::ensure($this->user, User::className());
foreach ($this->rules as $i => $rule) {
if (is_array($rule)) {
$this->rules[$i] = Yii::createObject(array_merge($this->ruleConfig, $rule));
}
}
}
示例7: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
$this->user = Instance::ensure($this->user, User::className());
}
示例8: init
/**
* Initializes the [[rules]] array by instantiating rule objects from configurations.
*/
public function init()
{
parent::init();
$this->user = Instance::ensure($this->user, User::className());
foreach ($this->rules as $i => $rule) {
if (is_array($rule)) {
$this->rules[$i] = Yii::createObject(array_merge($this->ruleConfig, $rule));
}
}
}
示例9: init
public function init()
{
parent::init();
$this->user = Yii::$app->getSession()->get('user');
}
示例10: init
public function init()
{
parent::init();
}
示例11: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
$this->initAllowActions();
}
示例12: init
public function init()
{
parent::init();
$this->rulesMap = (require __DIR__ . '/rulesMap.php');
}