I have the following code in the controller:
function add() {
if (!empty($this->data)) {
if ($this->Password->save($this->data)) {
$this->Session->setFlash('the password I_WANT_TO_DISPLAY_THE_INSERTED_PASSWORD_HERE was added');
$this->redirect(array('action' => 'index'));
}
}
}
The question is how can the inserted information be displayed in the view ?
A message something “The password XXX was addded into your database”.
I think the data must be retrieved from the text-field. I don’t know how to do this in cakePHP.
All the saved data is always available from the
$this->dataarray. You can use the syntax:For example if you saved the field
passwdto thepasswordstable, it should be: