致命错误:调用未定义的函数validation_errors()
这是代码:
class CCI extends Controller {
function CCI()
{
parent::Controller();
}
function index()
{
$this->load->helper('url');
$this->load->view('Users/login');
}
function test()
{
echo "Testing Data";
}
}
页面加载正常,直到我将“登录”页面的位置移动到“用户”文件夹内
Here is the code:
class CCI extends Controller {
function CCI()
{
parent::Controller();
}
function index()
{
$this->load->helper('url');
$this->load->view('Users/login');
}
function test()
{
echo "Testing Data";
}
}
The page was loading fine until I moved the location of the "login" page inside of the "Users" folder
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
那么可能会更改
为
由于您将文件移到了 Users 文件夹中,因此您需要调整路径。
Well then probably change
to
Since you moved the file inside the Users folder you need to adjust paths for that.
您可以使用“form_helper”中的“validation_errors”函数在视图中正确显示任何验证错误。也加载“form_helper”,你应该没问题。
You're properly displaying any validation errors within your view using the 'validation_errors' function that's located in the 'form_helper'. Load the 'form_helper' as well and you should be fine.
在控制器中添加以下两行代码:
Add following two lines of code to the controller: