질문
Q #11425
ci 공부중 궁금증
작업공간
2014-06-20 17:01:51
모델쪽입니다.
function get_list($table='ci_board', $type='', $offset='', $limit='') {
..............
}
컨트롤러 쪽입니다.
$config['total_rows'] = $this->board_m->get_list($this->uri->segment(3), 'count'); // 게시물의 전체 개수
위와같은 코드가 있으면
$this->uri_segment(3) 의 경우
http://---------/ci/index.php/board/lists/ci_board
이렇게 되어 있는데
segment(1) = board
segment(2) = lists
segment(3) = ci_board
일텐데요.
$this->uri->segment(3);이 없는
http://---------/ci/index.php/board/
주소를 저렇게 입력하면 모델부분의 첫번째변수는 $table='ci_board', 로 되어 있으니 $table 변수의 기본값은
'ci_board' 가 들어가주는게 맞지 않나요?
아무것도 넣지 않으면 아무런것도 실행이 되지 않네요.
테스트해보세요.
null도 값. ^^