重定向功能在codeigniter中不工作
当我运行此代码时重定向功能在codeigniter中不工作,codeigniter,Codeigniter,当我运行此代码时 public function LogInn() { $email = $this->input->post('email'); $password = $this->input->post('password'); $this->load->model('LogIn_Model'); $a = $this->LogIn_Model->Create_Sessi
public function LogInn()
{
$email = $this->input->post('email');
$password = $this->input->post('password');
$this->load->model('LogIn_Model');
$a = $this->LogIn_Model->Create_Session($email,$password);
if($a==1)
{
redirect('Hadees/word');
}
}
在日志文件中给出一个错误
ERROR - 2018-09-06 12:39:56 --> Severity: Error --> Call to undefined function redirect()
并且不重定向在同一文件中加载url或在自动加载文件中加载其工作
同一文件
$this->load->helper'url'//加载url帮助程序
自动加载文件
$autoload['helper']=数组'url' 尝试使用此重定向“/Hadees/word”、“刷新”;您是否已加载帮助程序$此->加载->帮助程序'url';通过更改notworkyes调用$this->load->helper'url';正如前面所说的,您应该加载url帮助程序,也不要在url中使用大写字母重定向。即使控制器也应该用UCFirst命名,类名也应该是UCFirst,url应该总是小写的。