當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。