Preview:
$this->load->library("form_validation");
$this->form_validation->set_rules("username", "User name", "trim|required");
if($this->form_validation->run() === FALSE)
{
     //$this->view_data["errors"] = validation_errors();
}
else
{
     //codes to run on success validation here
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter