我的codeigniter驗證錯誤不顯示某人可以提供幫助嗎? 我的代碼是Codeigniter驗證錯誤未顯示
public function addProduct(){
$this->load->view('header', $this->data);
$this->load->view('product/addProduct');
$this->load->view('footer');
$this->form_validation->set_rules('productName', 'Product Name', 'required|trim');
$this->form_validation->set_rules('productPrice', 'Product Price', 'required|trim');
if (!$this->form_validation->run() == FALSE)
{
// some stuff on validation success
}
else{
$this->load->view('product/addProduct');
}
}
,我已經加入 回波VALIDATION_ERRORS();在我看來,行爲的形式是產品/ addProduct。
因爲你必須在你的函數中通過驗證錯誤 –
@Nikhil Vaghla我必須在另一個函數中傳遞驗證錯誤? –
刪除第一個$ this-> load-> view('product/addProduct'); ($ this-> form_validation-> run()== FALSE) –