Beispiel #1
0
 function unique_url_title($url_title, $current_url_title = '')
 {
     $Categories = new Categories_model();
     // If in edit mode ignore its current name
     if ($current_url_title != '') {
         $Categories->where('url_title !=', $current_url_title);
     }
     $Categories->where('category_group_id', $this->uri->segment(5))->where('url_title', $url_title)->get();
     if ($Categories->exists()) {
         $this->form_validation->set_message('unique_url_title', 'The %s provided is already in use by anohter category in this category group.');
         return FALSE;
     } else {
         return TRUE;
     }
 }