Articles → PHP CODEIGNITER → Form_Open And Form_Close In Codeigniter

Form_Open And Form_Close In Codeigniter






Purpose


  1. "form_open" method renders the opening form tag.
  2. "form_close" method renders the closing form tag.

Example




$this->load->helper('form');




<body><div id="container"><div id="body"></div></div>
	<?php echo form_open(); 	?>
	<?php echo form_close(); ?></body>




Picture showing the rendered HTML with form tag
Click to Enlarge


Passing Attribute In The "Form_Open" Method




	<?php
$attributes = array(
    'method' => 'get',
    'id' => 'myform'
);
echo form_open('users_list', $attributes); ?><?php echo form_close(); ?>




Picture showing the rendered HTML when attributes are passed in form_open function
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Friday, July 31, 2020

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250