I\'ve started using Bootstrap in order to achieve a nice page design without resorting to GWT (the backend is made in java)
For my login screen I copied this example
Bootstrap V3:
Once i was searching for laravel features then i got to know this amazing form validation. Later on, i amended glyphicon icon features. Now, it looks great.
The Email field is required.
The Name field is required.
The Check No. field is required.
This is what it looks like:
Once i completed it i thought i should implement it in Codeigniter as well. So here is the Codeigniter-3 validation with Bootstrap:
Controller
function addData()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('email','Email','trim|required|valid_email|max_length[128]');
if($this->form_validation->run() == FALSE)
{
//validation fails. Load your view.
$this->loadViews('Load your view','pass your data to view if any');
}
else
{
//validation pass. Your code here.
}
}
View
'.form_error('email').'';
$emailClass = $email_error;
$emailIcon = '';
}
else{
$emailClass = $emailIcon = $emailData = '';
}
?>
= $emailIcon ?>
= $emailData ?>
Output: