Last active
August 29, 2015 13:57
-
-
Save aikchun/9636588 to your computer and use it in GitHub Desktop.
how to access variabel passed in through redirect
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
public function view() { | |
if($this->request->is('post')) { | |
$data = $this->request->data['HashAlgorithm']; | |
$this->log($data); | |
$this->redirect(array('controller' => 'HashResults' ,'action' => 'inputPlaintext', $data)); | |
} | |
$conditions = array( | |
'fields' => array('name'), | |
'order' => array('name ASC') | |
); | |
$this->Session->destroy(); | |
$data = $this->HashAlgorithm->find('all', $conditions); | |
$this->set('data', $data); | |
} | |
/** | |
* in HashResult controller | |
*/ | |
public function inputPlaintext() { | |
// how do I access $data. | |
} |
$this->redirect(array('controller' => 'HashResults' ,'action' => 'inputPlaintext', 'myString' => 'Hello World'));
public function inputPlaintext() {
$data = $this->request->myString;
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
try this
I think $data should be either string or number. Unlikely to handle array. But not 100% certain. Just try the above first and $this->log to let me know if it works.