本文整理匯總了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');
}