|
- <?php
- /**
- * Created by PhpStorm.
- * User: Steven
- * Date: 2018/7/13
- * Time: 17:25
- */
-
- namespace backend\modules\hotel\controllers;
-
-
- use backend\modules\hotel\models\OperaHotel;
-
- class OpenController extends BaseController
- {
- public $enableCsrfValidation = false;
- public $request_params;
-
-
- public function behaviors()
- {
- //配置ContentNegotiator支持JSON和XML响应格式
- $behaviors['contentNegotiator'] = [
- 'class' => ContentNegotiator::className(),
- 'formats' => [
- 'application/xml' => Response::FORMAT_JSON,
- ]
- ];
- $behaviors['access'] = [
- 'class' => AccessControl::className(),
- 'rules' => [
- [
- 'ips' => [
- '127.0.0.1'
- ],
- 'allow' => true,
- ],
- ],
- ];
- return $behaviors;
- }
-
- public function hotels()
- {
-
- $opera_hotel=new OperaHotel();
- }
-
- }
|