daryast

Untitled

Apr 10th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Class DefaultController
  5. */
  6. class DefaultController extends Controller
  7. {
  8. protected $testResponse;
  9. public $request;
  10. public $method;
  11. public $rules = array(
  12. array("allow",
  13. 'users' => array("*")
  14. )
  15. );
  16.  
  17. public function actionIndex()
  18. {
  19. $this->render('index');
  20. }
  21.  
  22. public function actionTest($exturl = '')
  23. {
  24. header('Content-type: text/html;charset=utf8');
  25.  
  26.  
  27. $url = Yii::app()->params['service'] . $exturl;
  28.  
  29. $this->testResponse = new ExternalService($url);
  30.  
  31. $method = Yii::app()->request->getRequestType();;
  32.  
  33. $request = Yii::app()->request->getRawBody();
  34.  
  35. $response = $this->testResponse->getResponse($method, $request);
  36.  
  37. echo($response);
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment