我已经在codeigniter中开发了一个模型 - 视图和控制器但是当我在url中调用控制器的功能而不是执行该控制器时,它会将我重新引导到主页
控制器:
public function job_post_list()
{
$data['job_posts']=$this->recruiter_post_job_model->get_posts();
$this->load->view('recruiter/job_post_list',$data);
$this->load->view('template/footer');
}
型号:
public function get_posts()
{
$logged_in=$this->session->userdata('logged_in');
$query="SELECT RPJ.*, CM.country_name, SM.state_name, CTM.city_name
FROM recruiter_post_jobs AS RPJ
LEFT JOIN country_master AS CM ON ( CM.country_id = RPJ.country_id )
LEFT JOIN state_master AS SM ON ( SM.state_id = RPJ.state_id )
LEFT JOIN city_master AS CTM ON ( CTM.city_id = RPJ.city_id )
WHERE RPJ.recruiter_id = ".$logged_in['user_id']." AND RPJ.job_status = 1";
$data=$this->db->query($query);
if($data->num_rows() > 0)
{
$results=$data->result();
return $results;
}
else
{
$results=NULL;
return $results;
}
}
任何人都请回答我。