[eluser]Tomer Simis[/eluser]
Ok guys, Im back. I've solved the problem
Code:
function alterar(){
if(!$this->uri->segment(3)){
$data['titulo'] = 'BSS Direct - Alterar categoria';
$data['categorias'] = $this->CategoriasModel->selectAll();
$this->load->view('header',$data);
$this->load->view('categorias/alterar');
}else{
$this->load->library('form_validation');
$this->form_validation->set_message('required','O campo <strong> %s </strong> é obrigatório');
$this->form_validation->set_error_delimiters('<li>', '</li>');
$data['titulo'] = 'BSS Direct - Alterar categoria';
$data['categoria'] = $this->CategoriasModel->selectDados($this->uri->segment(3));
$this->load->view('header',$data);
if($this->form_validation->run('categorias/alterar') == TRUE){
$this->load->view('categorias/alterar');
}else{
echo $this->input->post('nome');
$this->load->view('categorias/alterar_form');
}
}
}
I've put a parameter on the form validation and it worked, the "auto run on a config file" didn't work.
Cheers