Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your edit.ctp:</p> <pre><code>&lt;?php echo $form-&gt;create('Login'); echo $form-&gt;input('id'); echo $form-&gt;input('first_name'); echo $form-&gt;input('last_name'); echo $form-&gt;input('email'); echo $form-&gt;input('user_name'); echo $form-&gt;input('password'); echo $form-&gt;input('Userdetail.id');//updated echo $form-&gt;input('Userdetail.first_name'); echo $form-&gt;input('Userdetail.last_name'); echo $form-&gt;input('Userdetail.designation'); echo $form-&gt;input('Userdetail.contact'); echo $form-&gt;input('Userdetail.address'); echo $form-&gt;end('Submit'); ?&gt; </code></pre> <p>Your edit action in controller:</p> <pre><code>function edit($id = null) { $this-&gt;set('title_for_layout', __('Edit', true)); if (!$id &amp;&amp; empty($this-&gt;data)) { $this-&gt;Session-&gt;setFlash(__('Invalid ', true), 'default', array('class' =&gt; 'error')); $this-&gt;redirect(array('action'=&gt;'index')); } if (!empty($this-&gt;data)) { if ($this-&gt;Login-&gt;save($this-&gt;data)) { $this-&gt;Userdetail-&gt;create();//updated code $this-&gt;Userdetail-&gt;id = $this-&gt;data['Userdetail']['id'];//updated code if ($this-&gt;Userdetail-&gt;save($this-&gt;data['Userdetail'])) { $this-&gt;Session-&gt;setFlash(__('Data has been saved', true), 'default', array('class' =&gt; 'success')); $this-&gt;redirect(array('action'=&gt;'index')); } } else { $this-&gt;Session-&gt;setFlash(__('Data could not be saved. Please, try again.', true), 'default', array('class' =&gt; 'error')); } } if (empty($this-&gt;data)) { $this-&gt;data = $this-&gt;Login-&gt;read(null, $id); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload