I am making a customers CRUD application with Codeigniter 3. The "Add Customer" form view looks like this:
<div class="form-group <?php if(form_error('first_name')) echo 'has-error';?>">
<?php echo form_input('first_name', '', [
'type' => 'text',
'id' => 'first_name',
'class' => 'form-control',
'value' => '',
'placeholder' => 'First name',
]);
?>
<?php echo form_error('first_name'); ?>
</div>
The form also has validation on some of the text fields. I wish the data that is imputed, if data is invalid, would stay after submit. What shall I add to the code above?