【发布时间】:2019-11-25 16:32:50
【问题描述】:
我在application/helpers/ 中创建MY_form_helper.php,扩展form_helper.php。函数是这样的:
function alert($message,$type = 'success'){
$data = array(
'type' => $type,
'text' => $message
);
return json_encode($data);
}
在我的控制器中,我这样调用函数:
$this->load->helper(array('form', 'url'));
echo alert('Wrong email or password');
但它给了我一个错误
Message: Call to undefined function alert()
那么我在这里遗漏了什么或做错了什么?
【问题讨论】:
标签: php codeigniter codeigniter-3