当前位置: 首页>>代码示例>>PHP>>正文


PHP Action::beforeRun方法代码示例

本文整理汇总了PHP中yii\base\Action::beforeRun方法的典型用法代码示例。如果您正苦于以下问题:PHP Action::beforeRun方法的具体用法?PHP Action::beforeRun怎么用?PHP Action::beforeRun使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\base\Action的用法示例。


在下文中一共展示了Action::beforeRun方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: beforeRun

 /**
  * @return bool
  */
 public function beforeRun()
 {
     Yii::$app->view->title = 'Update Record';
     Yii::$app->view->params['breadcrumbs'][] = ['label' => 'Review Errors', 'url' => ['review-errors', 'id' => Yii::$app->request->get('id')]];
     Yii::$app->view->params['breadcrumbs'][] = Yii::$app->view->title;
     return parent::beforeRun();
 }
开发者ID:webtoolsnz,项目名称:yii2-importer,代码行数:10,代码来源:UpdateRecordAction.php

示例2: beforeRun

 protected function beforeRun()
 {
     if (is_callable($this->beforeRun)) {
         return call_user_func($this->beforeRun);
     }
     return parent::beforeRun();
 }
开发者ID:phpsong,项目名称:yii2-gtreetable,代码行数:7,代码来源:BaseAction.php

示例3: beforeRun

 /**
  * @return bool
  */
 public function beforeRun()
 {
     //crea interaccion visto
     if (!Yii::$app->user->isGuest) {
         list($municipio, $articulo) = Yii::$app->requestedParams;
         $articulo = $this->findModel($municipio, $articulo);
         $model = new InteraccionForm();
         $model->scenario = InteraccionForm::ESCENARIO_CREAR_VISTO;
         $model->usuario = Yii::$app->user->id;
         $model->visto = InteraccionForm::VISTO;
         $model->articulo = $articulo->idarticulo;
         $model->marcarVisto();
     }
     return parent::beforeRun();
     // TODO: Change the autogenerated stub
 }
开发者ID:alejandrososa,项目名称:AB,代码行数:19,代码来源:DetalleAction.php

示例4: beforeRun

 /**
  * @inheritdoc
  * @throws InvalidCallException if it is used in non-web application.
  * @throws InvalidConfigException if context was not found or incorrect context manager component.
  */
 protected function beforeRun()
 {
     if (!parent::beforeRun()) {
         return false;
     }
     if (!$this->getResponse() instanceof Response || !$this->getRequest() instanceof Request) {
         throw new InvalidCallException(static::className() . ' can be used with web applications only.');
     }
     if (!$this->getContextManager() instanceof ContextManager) {
         if (is_string($this->managerComponent)) {
             throw new InvalidConfigException("Incorrect context manager component name '{$this->contextManager}'.");
         } else {
             throw new InvalidConfigException('Incorrect type of $contextManager property: ' . gettype($this->contextManager) . '.');
         }
     }
     if (!$this->getContextManager()->hasContext($this->context)) {
         throw new InvalidConfigException("Unknown context name: '{$this->context}'.");
     }
     return true;
 }
开发者ID:alex-dwt,项目名称:file,代码行数:25,代码来源:UploadAction.php

示例5: beforeRun

 /**
  * @return bool
  */
 public function beforeRun()
 {
     Yii::$app->view->title = 'Review Errors';
     Yii::$app->view->params['breadcrumbs'][] = Yii::$app->view->title;
     return parent::beforeRun();
 }
开发者ID:webtoolsnz,项目名称:yii2-importer,代码行数:9,代码来源:ReviewErrorsAction.php

示例6: beforeRun

 /** @inheritdoc */
 public function beforeRun()
 {
     $this->controller->getView()->title = $this->title();
     $this->controller->getView()->params['breadcrumbs'] = $this->breadcrumbs();
     return parent::beforeRun();
 }
开发者ID:cheaterBY,项目名称:yii2-users-module,代码行数:7,代码来源:BaseAction.php

示例7: beforeRun

 /**
  * @return bool
  * @throws Exception
  */
 protected function beforeRun()
 {
     $this->initialRedirectUrl();
     $this->synchronizer = $this->getSynchonizer();
     return parent::beforeRun();
 }
开发者ID:ufocoder,项目名称:yii2-syncsocial,代码行数:10,代码来源:ActionSynchronize.php

示例8: beforeRun

 /**
  * This method is called right before `run()` is executed.
  * You may override this method to do preparation work for the action run.
  * If the method returns false, it will cancel the action.
  *
  * @return boolean whether to run the action.
  */
 protected function beforeRun()
 {
     $this->ipv4 = Yii::$app->get('ipv4');
     return parent::beforeRun();
 }
开发者ID:larryli,项目名称:ipv4-yii2,代码行数:12,代码来源:Action.php

示例9: beforeRun

 /**
  * @inheritdoc
  */
 public function beforeRun()
 {
     if (is_callable($this->beforeRun)) {
         return call_user_func($this->beforeRun, $this);
     }
     return parent::beforeRun();
 }
开发者ID:voskobovich,项目名称:yii2-admin-toolkit,代码行数:10,代码来源:BaseAction.php


注:本文中的yii\base\Action::beforeRun方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。