CodeIgniter
에 새롭게 추가되었습니다. 문제가 생겼어. 내 절차는 논리적으로 보이지만 작동하지 않을 것입니다!codeigniter : call 다른 메서드에서 메서드 인덱스
class User extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->model('user_model');
}
public function index($slug = FALSE) {
$data['title'] = "User List";
if($slug === FALSE) {
$data['user'] = $this->user_model->get_user();
} else {
$data['user'] = $this->user_model->get_user($slug);
}
if (empty($data['user'])){
show_404();
}
$this->load->library('table');
$this->load->view('user_view', $data);
}
public function authen() {
$this->load->helper('form');
$this->load->library('form_validation');
$this->form_validation->set_rules('phone', 'phone', 'required');
$this->form_validation->set_rules('password', 'password', 'required');
if ($this->form_validation->run() === FALSE) {
$this->load->view('login_form');
} else {
if($this->user_model->do_login()===TRUE) {
$this->index();
}
$this->authen();
}
}
}
은 "authen"방법 User
이 마지막 조건이 제대로 작동하지 않습니다 :
나는 컨트롤러를 가지고있다. 페이지가 컨트롤러로 리디렉션되지 않습니다.
아무도 도와 줄 수 있습니까? 감사
감사합니다. 작동합니다. 하지만 $ this-> index()가 작동하지 않는 이유는 무엇입니까? 사실 여러 구글 사이트는 그렇게 말하고 있습니다 .. –
이 하나를 확인해보십시오 : http://stackoverflow.com/questions/723883/redirect-with-codeigniter –