| 제목 | 안녕하세요. $this->pagination->initialize($config) ; 에러가 계속 나네요. ㅠ.ㅠ | ||
|---|---|---|---|
| 글쓴이 | 무쏘짱 | 작성시각 | 2015/10/15 18:13:23 | 
|  | |||
| 안녕하세요. CI 공부하면서 게시판 까지는 잘 됐습니다. Cafe24 에 호스팅을 새로 오픈하고 기존 소스 참고해서 새로운 작업 중인데 아래 부분에서 $this->pagination->initialize($config) ; 이 부분이 계속 에러가 납니다. 에러 메세지는 Severity: Notice Message: Undefined property: Item::$pagination Filename: controllers/item.php Line Number: 75 
class Item extends CI_Controller {
 	function __construct()
	{
		parent::__construct();
        $this->load->model(array('depart_m', 'item_m'));
		$this->load->helper(array('form', 'url', 'date', 'alert', 'viewutil'));
		$this->load->database();
//		$this->load->library(array('session', 'commonclass'));
		$this->load->library(array('session', 'commonclass', 'commonlogins'));
			//	폼 검증 라이브러리 로드
	}
	/**
	 * 사이트 헤더, 푸터가 자동 추가
	 */
	public function _remap($method)
	{
		//	헤더 include
		$this->load->view('header_v');
		if ( method_exists($this, $method) ) {
			$this->{"{$method}"}();
		}
		//	푸터 include
		$this->load->view('footer_v');
	}
	/**
	 * 주소에서 메소드가 생략되었을 때 실행되는 기본 메소드
	 */
	public function index()
	{
		$this->item_list();
	}
	public function t_item_list()
	{
		$cate1_num = $this->uri->segment(3) ;
		$cate2_num = $this->uri->segment(4) ;
		$search_word = $page_url = '' ;
		$uri_segment = 6 ;
		//	페이지네이션 라이브러리 로등 추가
		$this->load->library('pagination');
		$config['base_url'] = '/test_url/item/item_list/' . $cate1_num . '/' . $cate2_num . $page_url . '/page/' ;	//	페이징 주소
		$config['total_rows'] = $this->item_m->get_lists($cate1_num, $cate2_num, 'count', '', '', $search_word);		//	게시물 전체수
		$config['per_page'] = 15 ;	//	한페이지 표시할 게시물 수
		$config['uri_segment'] = $uri_segment ;	//	페이지 번호가 위치한 세그먼트
		//	페이지네이션 초기화
		$this->pagination->initialize($config) ;
	}
}
 | |||
| 다음글 | ci 로그인 오류 (6) | ||
| 이전글 | 오라클 UPDATE 쿼리 오류 질문 (7) | ||
| 
                                변종원(웅파)
                                /
                                2015/10/16 10:32:16 /
                                추천
                                0
                             | 
| 
                                무쏘짱
                                /
                                2015/10/16 10:52:05 /
                                추천
                                0
                             
                                define('CI_VERSION', '2.2.2');  이렇게 되어 있습니다...  다시 하나하나.. 확인중이에요. | 
| 
                                무쏘짱
                                /
                                2015/10/16 11:40:39 /
                                추천
                                0
                             
                                해결했습니다..  $uri_segment = 6 ; 이 부분이 잘못되었네요. $uri_segment = 7 ; 기본값이고, 검색어 들어갈땐 9 로 바꾸고.. 잘 됩니다.. 별거 아닌거로 몇시간 허비 .ㅠ.ㅠ | 
로그 활성화 해서 페이지네이션 라이브러리가 로딩되는지 확인해보세요.
에러메세지로는 로딩이 안되서 찾을 수 없는겁니다.
ci 버전은 어떻게 되죠?