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


PHP rest\ActiveController类代码示例

本文整理汇总了PHP中yii\rest\ActiveController的典型用法代码示例。如果您正苦于以下问题:PHP ActiveController类的具体用法?PHP ActiveController怎么用?PHP ActiveController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: actions

 /**
  * Override the base actions in order to support some enhancements of actions
  * by default for all active controllers.
  * @see \yii\rest\ActiveController::actions()
  */
 public function actions()
 {
     $actions = parent::actions();
     $actions['index']['class'] = '\\luya\\rest\\actions\\IndexAction';
     $actions['delete']['class'] = '\\luya\\rest\\actions\\DeleteAction';
     return $actions;
 }
开发者ID:luyadev,项目名称:luya-core,代码行数:12,代码来源:ActiveController.php

示例2: actions

 public function actions()
 {
     $actions = parent::actions();
     // personalizza il data provider preparation con il metodo "prepareDataProvider()"
     $actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider'];
     return $actions;
 }
开发者ID:antonio74,项目名称:daduu42,代码行数:7,代码来源:Contact_groupController.php

示例3: behaviors

 public function behaviors()
 {
     $behaviors = parent::behaviors();
     $behaviors['authenticator']['class'] = QueryParamAuth::className();
     $behaviors['authenticator']['tokenParam'] = 'access_token';
     return $behaviors;
 }
开发者ID:fosker,项目名称:dbm,代码行数:7,代码来源:ProfileController.php

示例4: behaviors

 public function behaviors()
 {
     $behaviors = parent::behaviors();
     $behaviors['authenticator'] = ['class' => HttpBearerAuth::className(), 'except' => ['options']];
     $behaviors['corsFilter'] = ['class' => Cors::className()];
     return $behaviors;
 }
开发者ID:kuznetsov0209,项目名称:mercdev-soccer-server,代码行数:7,代码来源:SecureActiveController.php

示例5: actions

 public function actions()
 {
     $actions = parent::actions();
     unset($actions['index']);
     unset($actions['view']);
     return $actions;
 }
开发者ID:Acker2015,项目名称:CustomizeLife,代码行数:7,代码来源:MessageController.php

示例6: behaviors

 public function behaviors()
 {
     $behaviors = parent::behaviors();
     $behaviors['authenticator'] = ['class' => HttpBearerAuth::className()];
     $behaviors['contentNegotiator'] = ['class' => ContentNegotiator::className(), 'formats' => ['application/json' => Response::FORMAT_JSON]];
     return $behaviors;
 }
开发者ID:AndriyK,项目名称:team,代码行数:7,代码来源:TeamController.php

示例7: behaviors

 public function behaviors()
 {
     $behaviors = parent::behaviors();
     $behaviors['authenticator'] = ['class' => CompositeAuth::className(), 'except' => ['login', 'error'], 'authMethods' => [HttpBearerAuth::className()]];
     unset($behaviors['rateLimiter']);
     return $behaviors;
 }
开发者ID:bookin,项目名称:yii2-rest-example,代码行数:7,代码来源:Controller.php

示例8: behaviors

 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     $behaviors = parent::behaviors();
     $behaviors['rateLimiter'] = ['class' => RateLimiter::className(), 'enableRateLimitHeaders' => false];
     $behaviors['contentNegotiator'] = ['class' => ContentNegotiator::className(), 'formats' => ['application/json' => Response::FORMAT_JSON]];
     return $behaviors;
 }
开发者ID:pylypen,项目名称:api-side,代码行数:10,代码来源:UserController.php

示例9: behaviors

 public function behaviors()
 {
     $behaviors = parent::behaviors();
     //$behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_JSON; //setting JSON as default reply
     $behaviors['authenticator'] = ['class' => CompositeAuth::className(), 'authMethods' => [HttpBasicAuth::className(), HttpBearerAuth::className(), QueryParamAuth::className()]];
     return $behaviors;
 }
开发者ID:dimichspb,项目名称:yii2-api-auth,代码行数:7,代码来源:CountryController.php

示例10: behaviors

 public function behaviors()
 {
     $behaviors = parent::behaviors();
     /*
     // test with basic auth which can be set in params
     $behaviors['authenticator'] = [
     'class' => HttpBasicAuth::className(),
     'auth'  => function ($username, $password) {
         if ($username==\Yii::$app->params['HttpBasicAuth']['username'] && $password==\Yii::$app->params['HttpBasicAuth']['password']) {
             return new User();
         } else {
             return null;
         }
     }];
     */
     $behaviors['authenticator'] = ['class' => CompositeAuth::className(), 'authMethods' => [HttpBasicAuth::className(), QueryParamAuth::className()]];
     /*
     //set response header to application/json only
     $behaviors['contentNegotiator'] = [
             'class' => ContentNegotiator::className(),
             'formats' => [
                 'application/json' => Response::FORMAT_JSON,
     //            'application/xml' => Response::FORMAT_XML,
             ],
     ];
     */
     return $behaviors;
 }
开发者ID:EuresTools,项目名称:eVote-web,代码行数:28,代码来源:BaseRestController.php

示例11: actions

 public function actions()
 {
     $actions = parent::actions();
     unset($actions['index'], $actions['update'], $actions['create'], $actions['delete'], $actions['view']);
     //unset($actions['update'], $actions['create'], $actions['delete'], $actions['view']);
     return $actions;
 }
开发者ID:C12D,项目名称:advancedapi,代码行数:7,代码来源:PilotpController+ver3.php

示例12: behaviors

 public function behaviors()
 {
     $self = self::className();
     $behaviors = parent::behaviors();
     $behaviors['access'] = ['class' => \app\components\filters\AccessControl::className(), 'rules' => $self::getAccessRules()];
     return $behaviors;
 }
开发者ID:KleinMaximus,项目名称:pickam,代码行数:7,代码来源:ActiveController.php

示例13: behaviors

 public function behaviors()
 {
     $behaviors = parent::behaviors();
     $behaviors['verbs'] = ['class' => VerbFilter::className(), 'actions' => ['indexWithQuote' => ['get']]];
     $behaviors['authenticator'] = ['class' => HttpBasicAuth::className()];
     return $behaviors;
 }
开发者ID:soanni,项目名称:stocks_mvc,代码行数:7,代码来源:RatesController.php

示例14: behaviors

 public function behaviors()
 {
     $behaviors = parent::behaviors();
     // enabled HttpBearerAuth
     $behaviors['authenticator'] = ['class' => HttpBearerAuth::className()];
     return $behaviors;
 }
开发者ID:gnatyuk,项目名称:rest,代码行数:7,代码来源:Controller.php

示例15: behaviors

 /**
  * Some rules in this controller
  * @return Rules behaviors
  */
 public function behaviors()
 {
     $behaviors = parent::behaviors();
     $behaviors['authenticator'] = ['class' => QueryParamAuth::className(), 'tokenParam' => 'token'];
     unset($behaviors['rateLimiter']);
     return $behaviors;
 }
开发者ID:bolom009,项目名称:testwork_api,代码行数:11,代码来源:UserController.php


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