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


PHP Controller::actions方法代码示例

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


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

示例1: actions

 /**
  * @inheritdoc
  */
 public function actions()
 {
     $actions = parent::actions();
     $actions['login'] = ['class' => LoginAction::className(), 'modelClass' => $this->modelClass];
     $actions['logout'] = ['class' => LogoutAction::className()];
     return $actions;
 }
开发者ID:voskobovich,项目名称:yii2-auth-toolkit,代码行数:10,代码来源:AuthController.php

示例2: getActions

 /**
  * Returns all available actions of the specified controller.
  * @param Controller $controller the controller instance
  * @return array all available action IDs.
  */
 public function getActions($controller)
 {
     $actions = array_keys($controller->actions());
     $class = new \ReflectionClass($controller);
     foreach ($class->getMethods() as $method) {
         $name = $method->getName();
         if ($name !== 'actions' && $method->isPublic() && !$method->isStatic() && strpos($name, 'action') === 0) {
             $actions[] = Inflector::camel2id(substr($name, 6), '-', true);
         }
     }
     sort($actions);
     return array_unique($actions);
 }
开发者ID:songhongyu,项目名称:datecenter,代码行数:18,代码来源:CommandController.php

示例3: actions

 public function actions()
 {
     $actions = parent::actions();
     if (Yii::$app->user->isGuest) {
         return $this->redirect(Url::toroute('site/login'));
     }
     return $actions;
 }
开发者ID:Godscreature,项目名称:Books,代码行数:8,代码来源:BookController.php

示例4: actions

 public function actions()
 {
     parent::actions();
     /*
      * http://www.yiiframework.ru/forum/viewtopic.php?f=9&t=22866#p141025
      * логика такова: загрузил изображение по пути указанному в path, а в редакторе, в src изображения прописал url
      * behaviour - download image by path defined in path variable and in redactor define src for image from url variable
      */
     return ['image-upload' => ['class' => 'vova07\\imperavi\\actions\\UploadAction', 'url' => Yii::getAlias(Yii::$app->controller->module->itemImageURL), 'path' => Yii::getAlias(Yii::$app->controller->module->itemImagePath)], 'images-get' => ['class' => 'vova07\\imperavi\\actions\\GetAction', 'url' => Yii::getAlias(Yii::$app->controller->module->itemImageURL), 'path' => Yii::getAlias(Yii::$app->controller->module->itemImagePath), 'type' => \vova07\imperavi\actions\GetAction::TYPE_IMAGES]];
 }
开发者ID:vladkukushkin,项目名称:yii2-articles,代码行数:10,代码来源:ItemsController.php

示例5: actions

 public function actions()
 {
     if (is_array($this->actions)) {
         return $this->actions;
     }
     if (is_callable($this->actions)) {
         return call_user_func($this->actions, $this);
     }
     return parent::actions();
 }
开发者ID:mihaildev,项目名称:yii2-flexible-controller,代码行数:10,代码来源:Controller.php

示例6: actions

 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['toggle' => ['class' => ToggleAction::className(), 'modelClass' => OptionsList::className(), 'setFlash' => true, 'attribute' => 'active', 'primaryKey' => 'id'], 'editsort' => ['class' => EditableColumnAction::className(), 'modelClass' => OptionsList::className(), 'outputValue' => function ($model, $attribute, $key, $index) {
         return (int) $model->{$attribute};
         // return any custom output value if desired
     }, 'outputMessage' => function ($model, $attribute, $key, $index) {
         return '';
         // any custom error to return after model save
     }, 'showModelErrors' => true, 'errorOptions' => ['header' => ''], 'postOnly' => true, 'ajaxOnly' => true]]);
 }
开发者ID:porcelanosa,项目名称:yii2-options,代码行数:10,代码来源:OptionslistController.php

示例7: actions

 public function actions()
 {
     $actions = ['list' => ['class' => 'sibds\\controllers\\actions\\ListAction'], 'trash' => ['class' => 'sibds\\controllers\\actions\\TrashAction'], 'copy' => ['class' => 'sibds\\controllers\\actions\\CopyAction'], 'update' => ['class' => 'sibds\\controllers\\actions\\UpdateAction'], 'unlock' => ['class' => 'sibds\\controllers\\actions\\UnlockAction'], 'lock' => ['class' => 'sibds\\controllers\\actions\\LockAction'], 'delete' => ['class' => 'sibds\\controllers\\actions\\DeleteAction'], 'restore' => ['class' => 'sibds\\controllers\\actions\\RestoreAction']];
     if ($this->testBehavior(new NestedSetsBehavior())) {
         $actions['nodeMove'] = ['class' => 'sibds\\controllers\\actions\\NodeMoveAction'];
     }
     if ($this->testBehavior(new GalleryBehavior())) {
         $actions['galleryApi'] = ['class' => 'zxbodya\\yii2\\galleryManager\\GalleryManagerAction'];
     }
     return ArrayHelper::merge($actions, parent::actions());
     // TODO: Change the autogenerated stub
 }
开发者ID:sibds,项目名称:yii2-standart-controller,代码行数:12,代码来源:StandartController.php

示例8: actions

 public function actions()
 {
     parent::actions();
     /*
      * http://www.yiiframework.ru/forum/viewtopic.php?t=22866#p141006
      * "url" - this is the link to web-accessible folder where file will be stored. At this time file will be uploaded
      * in temporary folder, that`s why URL is temporary to.
      * "path" - this is the path to temporary folder where file will be uploaded. At the beginning widget load file to
      * the temporary folder which defined by variable "path". And when you save record file will be moved to constant
      * folder. You should define same folders.
      * "url" - это ссылка к директории с веб доступом в которой будет загружен сам файл. Подразумевается что
      * в конкретно данной ситуации загрузка происходит во временную папку, по этому и УРЛ будет временным.
      * "path" - это путь к временной папке куда будет загружен файл. Данный виджет имеет такую логику что он
      * предварительно загружает файл в временную папку, именно в той что указано в "path". И только при сохранении
      * он перемещает файл в постоянную папку. надо указывать одну и туже папку
      */
     return ['image-upload' => ['class' => 'vova07\\imperavi\\actions\\UploadAction', 'url' => $this->module->imagesUrl, 'path' => $this->module->imagesPath], 'images-get' => ['class' => 'vova07\\imperavi\\actions\\GetAction', 'url' => $this->module->imagesUrl, 'path' => $this->module->imagesPath, 'type' => \vova07\imperavi\actions\GetAction::TYPE_IMAGES]];
 }
开发者ID:vladkukushkin,项目名称:yii2-faq,代码行数:18,代码来源:DefaultController.php

示例9: actions

 public function actions()
 {
     return parent::actions();
     // TODO: Change the autogenerated stub
 }
开发者ID:zhongchin,项目名称:yii-blog,代码行数:5,代码来源:UserController.php

示例10: actions

 /**
  * Declares class-based actions.
  * For change functional use AuthUserBehavior, This is component
  * declaret in to config.php, you can change him.
  * Auth event:
  *
  * - beforeLogin(ActionEvent)
  * - afterLogin(ActionEvent)
  * - errorLogin(ActionEvent)
  *
  * - beforeSignup(ActionEvent)
  * - afterSignup(ActionEvent)
  * - errorSignup(ActionEvent)
  *
  * - beforeCheckRecoveryKey(ActionEvent)
  * - afterCheckRecoveryKey(ActionEvent)
  * - errorCheckRecoveryKey(ActionEvent)
  *
  * - beforeForgot(ActionEvent)
  * - afterForgot(ActionEvent)
  * - errorForgot(ActionEvent)
  *
  * - beforeLogout(ActionEvent)
  * - afterLogout(ActionEvent)
  *
  * Also if you use extensions evenement, use this events,
  * Insert into listeners.php:
  *
  * ...
  * yiicod.auth.controllers.WebUserBase.[All event name before]
  * ...
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['login' => ['class' => \yiicod\auth\actions\webUser\LoginAction::className()], 'requestPasswordReset' => ['class' => \yiicod\auth\actions\webUser\RequestPasswordResetAction::className()], 'logout' => ['class' => \yiicod\auth\actions\webUser\LogoutAction::className()], 'signup' => ['class' => \yiicod\auth\actions\webUser\SignupAction::className()], 'resetPassword' => ['class' => \yiicod\auth\actions\webUser\ResetPasswordAction::className()]]);
 }
开发者ID:yiicod,项目名称:yii2-auth,代码行数:36,代码来源:WebUserController.php

示例11: actions

 /**
  * @inheritDoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['upload' => ['class' => UEditorAction::className()]]);
 }
开发者ID:tqsq2005,项目名称:Yii2adv,代码行数:7,代码来源:Ji_sheng_feng_caiController.php

示例12: actions

 public function actions()
 {
     parent::actions();
     return ['index' => ['class' => 'yii\\web\\ErrorAction']];
 }
开发者ID:quynhvv,项目名称:stepup,代码行数:5,代码来源:ErrorController.php

示例13: actions

 /**
  * @inheritdoc
  */
 public function actions()
 {
     return array_merge(parent::actions(), ['error' => ['class' => 'yii\\web\\ErrorAction']]);
 }
开发者ID:spiro-stathakis,项目名称:projects,代码行数:7,代码来源:XController.php

示例14: actions

 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['create-client' => ['class' => actions\CreateUser::className(), 'view' => '@app/modules/manager/views/default/createClient.php', 'redirectAction' => 'update-client-profile', 'role' => 'client'], 'update-client-profile' => ['class' => actions\UpdateProfile::className(), 'view' => '@app/modules/client/views/default/profile.php', 'redirectAction' => '/', 'modelClass' => 'app\\modules\\user\\models\\User'], 'profile' => ['class' => actions\UpdateProfile::className(), 'view' => '@app/modules/manager/views/default/profile.php', 'redirectAction' => '/manager/default/profile', 'modelClass' => 'app\\modules\\user\\models\\User', 'isManagerProfile' => true]]);
 }
开发者ID:kvaxminsk,项目名称:evo8,代码行数:4,代码来源:DefaultController.php


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