Created
July 12, 2012 17:03
-
-
Save mmohiudd/3099337 to your computer and use it in GitHub Desktop.
$_REQUEST variable for Kohana
This file contains 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
class Controller_Home extends Controller { | |
protected $args; // store GET/POST variables | |
public function before() { | |
parent::before(); | |
// if a GET request | |
if( $this->request->method() == "GET" ) { | |
$this->args = $this->request->query(); | |
} else { | |
$this->args = $this->request->post(); | |
} | |
} | |
public function action_index() { | |
$my_var = isset( $this->args['my_var'] ) ? $this->args['my_var'] : NULL; | |
echo $my_var; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment