Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have created controller named : Test_controller and view named : manage_test_controller and using below code you can get data from view file to controller. </p> <p>Test_controller.php</p> <pre><code> class Test_controller extends CI_Controller { var $controller = "user"; var $formValues = array(); function manage_user() { $this-&gt;formValues['formAction'] = SITEURL . '/' . $this-&gt;controller . '/manage_' . $this-&gt;controller; if (isset($_POST['displayName'])) $this-&gt;formValues['displayName'] = $_POST['displayName']; else $this-&gt;formValues['displayName'] = ""; if (isset($_POST['userEmail'])) $this-&gt;formValues['userEmail'] = $_POST['userEmail']; else $this-&gt;formValues['userEmail'] = ""; $this-&gt;load-&gt;view('header'); $this-&gt;load-&gt;view($this-&gt;controller . '/manage_' . $this-&gt;controller, $this-&gt;formValues); $this-&gt;load-&gt;view('footer'); } } </code></pre> <p>Manage_test_controller.php</p> <pre><code>&lt;?php echo form_open_multipart($formAction); ?&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;&lt;?php echo form_label('Display Name'); ?&gt;&lt;em&gt;*&lt;/em&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo form_input('displayName',$displayName); ?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;?php echo form_label('Email'); ?&gt;&lt;em&gt;*&lt;/em&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo form_input('userEmail',$userEmail); ?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;?php echo form_close(); ?&gt; </code></pre> <p>Hope this code will help you.... :)</p>
 

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