Не выводить сообщения об ошибках формы

У меня есть форма, которая не выводит какие-либо сообщения об ошибках, я что-то пропустил?

Модель:

function createUser($username = NULL ,$passwordHash = NULL ,$firstname = NULL ,$lastname = NULL ,$email = NULL,$group = NULL ,$active = NULL) { $data = array('userName' => $username, 'userFirstName' => $firstname, 'userLastName' => $lastname, 'userEmail' => $email, 'userPassword' => sha1($passwordHash), 'userGroup' => $group, 'userActive' => $active); $this->db->insert('users',$data); return TRUE; } 

Посмотреть:

 <h1><?php echo $companyName; echo nbs(1);?> - <?php echo $pageTitle; ?></h1> <?php if($success == TRUE) { echo '<section id = "validation">Page Updated</section>'; } ?> <p>Error: <?php echo validation_errors();?> </p> <div class="formContent"> <form action="createUser" method="post"> <fieldset class="control-group"> <label for="userName">User Name: <input type="text" name="userName" value="<?php echo set_value('userName'); ?>" placeholder="User Name"></label> <label for="userPassword">User Password: <input type="password" name="userPassword" value="<?php echo set_value('userPassword'); ?>" placeholder="User Password"></label> <label for="userFirstName">First Name: <input type="text" name="userFirstName" value="<?php echo set_value('userFirstName'); ?>" placeholder="First Name"></label> <label for="userLastName">Last Name: <input type="text" name="userLastName" value="<?php echo set_value('userLastName'); ?>" placeholder="Last Name"></label> <label for="userEmail">E-Mail: <input type="text" name="userEmail" value="<?php echo set_value('userEmail'); ?>" placeholder="Admin E-mail"></label> <label for="userGroup"> User Group: <select name="userGroup" value="<?php echo set_value('userGroup'); ?>"> <option value="select">Please Select</option> <option value="admin">Admin Group</option> <option value="user">User Group</option> </select> </label> <label for="userActive"> User Active: <select name="userActive" value="<?php echo set_value('userActive'); ?>"> <option value="select">Please Select</option> <option value="yes">Yes</option> <option value="no">No</option> </select> </label> <button type="submit" class="btn-primary">Create</button> </fieldset> </form> </div> 

контроллер:

  public function index() { $data['companyName'] = $this->core_model->companyName(); $data['success'] =""; $data['pageTitle'] = "Create User"; $this->load->view('admin/assets/header', $data); $this->load->view('admin/createUser', $data); $this->load->view('admin/assets/footer'); if($this->input->post('submit')) { $this->form_validation->set_rules('userName', 'User Name', 'trim|required|xss_clean|callback_username_check'); $this->form_validation->set_rules('userPassword', 'User Password', 'trim|required|xss_clean|sha1'); $this->form_validation->set_rules('userFirstName', 'First Name', 'trim|required|xss_clean'); $this->form_validation->set_rules('userLastName', 'Last Name', 'trim|required|xss_clean'); $this->form_validation->set_rules('userEmail', 'E-Mail', 'trim|required|xss_clean'); $this->form_validation->set_rules('userGroup', 'User Group', 'trim|required|xss_clean'); $this->form_validation->set_rules('userActive', 'User Active', 'trim|required|xss_clean'); if ($this->form_validation->run() == FALSE) { $data['companyName'] = $this->core_model->companyName(); $data['success'] =""; $data['pageTitle'] = "Create User"; $this->load->view('admin/assets/header', $data); $this->load->view('admin/createUser', $data); $this->load->view('admin/assets/footer'); }else{ $username = $this->input->post('userName',TRUE); $password = $this->input->post('userPassword', TRUE); $firstname = $this->input->post('userFirstName', TRUE); $lastname = $this->input->post('userLastName',TRUE); $email = $this->input->post('userEmail',TRUE); $group = $this->input->post('userGroup',TRUE); $active = $this->input->post('userActive', TRUE); $this->db->escape($username); $this->db->escape($password); $this->db->escape($firstname); $this->db->escape($lastname); $this->db->escape($email); $this->db->escape($group); $this->db->escape($active); $passwordHash = $this->encrypt->sha1($password); if ($this->core_model->createUser($username,$passwordHash,$firstname,$lastname,$email,$group,$active)) { $data['success'] = TRUE; $data['companyName'] = $this->core_model->companyName(); $data['pageTitle'] = "Create User"; $this->load->view('admin/assets/header', $data); $this->load->view('admin/createUser', $data); $this->load->view('admin/assets/footer'); }else{ $data['companyName'] = $this->core_model->companyName(); $data['pageTitle'] = "Create User"; $this->load->view('admin/assets/header', $data); $this->load->view('admin/createUser', $data); $this->load->view('admin/assets/footer'); } } } } function __username_check($userName){ { if ($userName == $user->$userName) { $this->form_validation->set_message('username_check','Sorry the chosen username %s is taken!'); return false; }else{ return true; } } } } /* End of file login.php */ /* Location: ./application/controllers/admin/createUser.php */