[eluser]iniweb[/eluser]
Code:
Code:
function News_Add()
{
$data = array(
'error' => $this->validation->error_string
);
$content = $this->parser->parse('Backoffice/News_Add.tpl', $data);
$data = array(
'content' => $content,
'sysblock' => SysBlock::Index()
);
$this->parser->parse('Backoffice/main.tpl', $data);
}
function News_Add_Check()
{
$this->load->model('NewsModel');
$rules['author'] = "trim|required";
$this->validation->set_rules($rules);
if ($this->validation->run() == FALSE) {
redirect('/index.php?c=Backoffice&m=News_Add', 'refresh');
} else {
$this->NewsModel->Insert_News();
redirect('/index.php?c=Backoffice&m=News_List', 'refresh');
}
}
Now error returned on function News_add_check, but need return error on function News_Add(). How?