daryast

Untitled

Apr 10th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 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()
  23. {
  24. header('Content-type: text/html;charset=utf8');
  25.  
  26. $url = Yii::app()->params['service'] . '/webresources/uin/generate';
  27.  
  28. $this->testResponse = new ExternalService($url);
  29.  
  30. $method = Yii::app()->request->getRequestType();;
  31.  
  32. $request = Yii::app()->request->getRawBody();
  33.  
  34. $response = $this->testResponse->getResponse($method, $request);
  35.  
  36. echo($response);
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment