Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

49 wiersze
1.0 KiB

  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Steven
  5. * Date: 2018/7/13
  6. * Time: 17:25
  7. */
  8. namespace backend\modules\hotel\controllers;
  9. use backend\modules\hotel\models\OperaHotel;
  10. class OpenController extends BaseController
  11. {
  12. public $enableCsrfValidation = false;
  13. public $request_params;
  14. public function behaviors()
  15. {
  16. //配置ContentNegotiator支持JSON和XML响应格式
  17. $behaviors['contentNegotiator'] = [
  18. 'class' => ContentNegotiator::className(),
  19. 'formats' => [
  20. 'application/xml' => Response::FORMAT_JSON,
  21. ]
  22. ];
  23. $behaviors['access'] = [
  24. 'class' => AccessControl::className(),
  25. 'rules' => [
  26. [
  27. 'ips' => [
  28. '127.0.0.1'
  29. ],
  30. 'allow' => true,
  31. ],
  32. ],
  33. ];
  34. return $behaviors;
  35. }
  36. public function hotels()
  37. {
  38. $opera_hotel=new OperaHotel();
  39. }
  40. }