0
CodeIgniter和Ocular的新手都很適合我。Codeigniter Ocular和表單驗證
我用運行表單驗證(其中指數()方法中包含的形式加載代碼)時,按以下方式進行編碼:
if ($this->form_validation->run() == FALSE)
{
$this->index();
}
else
{
$this->load->view('view_name', $data);
}
不過我現在試圖用眼模板庫和上面的代碼不再工作見下面的例子:
if ($this->form_validation->run() == FALSE)
{
$this->index();
}
else
{
$this->template->set($data);
$this->template->render();
}
上面的代碼不通過索引方式運行,因爲它使用無眼,我想知道最好的做法是,或者即使我以前來糾正這個是什麼代碼是最佳實踐?
問候, Numan1617
表單驗證應在模型中進行,而不是控制器 – iaintunderstand
@iaintunderstand這是一個相當流行的** **的意見,這些天。 – jondavidjohn