CI 묻고 답하기

제목 BASE_URL 관련해서 질문 드립니다.
글쓴이 andy_gd 작성시각 2014/11/21 20:43:54
댓글 : 2 추천 : 0 스크랩 : 0 조회수 : 13131   RSS
안녕하세요. 카이도님이 작성하신 페이징레이션 강의를 들으면서 작성 중인데. 다음과 같은 오류가 발생했습니다. ㅠㅠ




---------------------------------------컨트롤
class GODJ_control extends CI_Controller{
 
 function GODJ_control(){
  parent::__construct();
  $this->load->database('default');
  $this->load->model('GODJ_model');
  $this->load->helper('form');
  $this->load->helper('url');
  
  $this->load->library('pagination_custom');
  
  $this->segs = $this->uri->segment_array();
  $this->output->enable_profiler(true);
 }
 
 function main(){
  
 
  $this->load->view('GODJ_page/GODJ_top'); //Layout top
  $this->load->view('GODJ_page/GODJ_left'); //Layout left
  $this->load->view('GODJ_page/GODJ_menu'); //Layout menu
  
  //$data['GODJ_body_lists'] = $this->GODJ_model->model();
  
  $page = $this->uri->segment(3);
  $pagelist= 20;
  $db_data = $this->GODJ_model->model($page,$pagelist);
  
  $link_url = "/".$this->segs[1]."/".$this->segs[2]."/";
  $total_count = $db_data['total_cnt'];
  $config = $this->pagination_custom->pagenation_b($page,$total_count,$pagelist,$link_url,$segment=3,$num_link=3);
  $this->pagination_custom->initialize($config);

  $data['GODJ_body_lists'] = $db_data['model'];
  $data['GODJ_page'] = $this->pagination_custom->create_links();
  
  $this->load->view("GODJ_page/GODJ_body",$data);

  $this->load->view('GODJ_page/GODJ_right'); //Layout right
  $this->load->view('GODJ_page/GODJ_footer'); //Layout footer
 }
 
}
--------------------------------------라이브러리
function pagenation_b($page='',$totalcount='',$listsize=0,$link_url='',$segment='',$num_link=''){
  $total_page = ceil($totalcount/$listsize);
  $config['total_rows'] = $total_page;
  $config['per_page'] = 1;
 
  $config['uri_segment'] = $segment;
  $config['num_links'] = $num_link;
  $config['base_url'] = BASE_URL.$link_url;
 
 다음글 image_library 를 이용한 resize가 안되... (2)
 이전글 한글로 POST 하는데 컨트롤러에서 글씨가 깨져서 나와... (1)

댓글

권라떼 / 2014/11/22 23:51:54 / 추천 0
BASE_URL을 base_url() 로 변경하시면 됩니다.
andy_gd / 2014/11/27 09:09:46 / 추천 0
권라떼/ 감사합니다! 해결했어요 ^^ 원인은 BASE_URL이 잘못설정되어있었네요