可能有一些我錯過了。我環顧網絡,因此沒有任何答案可以幫我解決這個問題。這是我的問題:我在__construct
方法中加載form_validation
庫仍然PHP抱怨validation_errors
方法未定義。還有form
助手是自動加載的。Codeigniter validation_errors函數未定義
...
...
function __construct()
{
parent::__construct();
$this->load->library('ion_auth');
$this->load->library('form_validation');
$this->load->helper('url');
....
....
function login()
{
$this->data['title'] = "Login";
.....
.....
//the user is not logging in so display the login page
//set the flash data error message if there is one
$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');
上面最後一行出現錯誤。 (此代碼是ion_auth模塊http://benedmunds.com/ion_auth/的一部分)
您是否已經運行驗證? –
編號頁面錯誤在第一次命中本身。 – nilobarp