Articles → PHP CODEIGNITER → form_open and form_close in codeigniter

form_open and form_close in codeigniter






Purpose







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