how to get the value on form input in cakephp
10,872
You can get it
$val = $this->data['ModelName']['username']; //CakePHP 1.X.X
//or
$this->request->data['ModelName']['username']); //CakePHP 2.X.X
Where "ModelName" is your currently assigned model to form.
Update:
$user = $this->Account->find('first', array(
'conditions' => array(
'username' => 'user1'
)
));
Author by
John Micah Fernandez Miguel
Updated on June 04, 2022Comments
-
John Micah Fernandez Miguel almost 2 years
I have:
echo $this->Form->input('username', array('label' => 'Username: '));
equivalent to in traditional php coding..
how can I get the value inputted in that textbox like when you do $val = $_POST['username']; in traditional php coding.
I need this for login validation. thanks