Created
April 4, 2018 08:47
-
-
Save Tobur/7e9cfcfaf98756e5f3b5da796c103f05 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @TODO find out yii 1 way to split extion per request method | |
* | |
* @throws CException | |
*/ | |
public function actionIndex() | |
{ | |
$request = $this->getRequest(); | |
if ($request->getIsPostRequest()) { | |
$this->update(); | |
return; | |
} | |
if ('GET' === $request->getRequestType()) { | |
$this->view(); | |
return; | |
} | |
$this->throwErrorException( | |
'Unable to find action. Able only get and post!', | |
HttpCodeHelper::FORBIDDEN | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment