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