Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Class DefaultController
- */
- class DefaultController extends Controller
- {
- protected $testResponse;
- public $request;
- public $method;
- public $exturl;
- public $rules = array(
- array("allow",
- 'users' => array("*")
- )
- );
- public function actionIndex()
- {
- $this->render('index');
- }
- public function actionTest($exturl = '')
- {
- header('Content-type: text/html;charset=utf8');
- $url = Yii::app()->params['service'] . $exturl;
- $this->testResponse = new ExternalService($url);
- $method = Yii::app()->request->getRequestType();;
- $request = Yii::app()->request->getRawBody();
- $response = $this->testResponse->getResponse($method, $request);
- echo($response);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment