2014-04-18 3 views
0

저는 메인 페이지가 기본적으로 각 이미지 하단에 간단한 예/아니오 투표 버튼이있는 이미지 격자 인 이미지 등급 어플리케이션을 만들고 있습니다.URI 세그먼트가없는 Codeigniter 페이지 매김

저는 서버 측에 Codeigniter, 인터페이스 용으로 부트 스트랩 (CSS와 JS 모두)을 사용하고 있습니다.

이제 모든 이미지를 한꺼번에로드하고 싶지는 않지만 이미지를 페이지 수, 즉로드 시간을 줄이기 위해 10 개의 이미지가 포함 된 페이지로 나눕니다.

나는 날이 코드의 변형 활용하고자 The CI Docs @ 문서를 통해 찾아 봤는데이 생산

$this->load->library('pagination'); 

$config['base_url'] = 'imgapp.com'; 
$config['total_rows'] = 100; 
$config['per_page'] = 10; 

$this->pagination->initialize($config); 

echo $this->pagination->create_links(); 

:

enter image description here

문제는이다, I URI 세그먼트 (segment)를 가능하게하는 방법으로 그것을 구축하지 않았다.

그래서, 링크는 꽤 쓸모가 - 그들은 이런 종류의 ADRESS를 가리키는 : 나를 위해 쓸모가

http://www.imgapp.com/default_controller/3

.

내 이미지 앱에서 작동하도록 페이지 매김을 구성하는 방법은 무엇입니까? 페이지 매김을 구성 할 수

답변

0

확인 http://ellislab.com/codeigniter/user-guide/libraries/pagination.html 키는 다음과 같습니다

$config['uri_segment'] = 3; 
The pagination function automatically determines which segment of your URI contains the page number. If you need something different you can specify it. 

$config['base_url'] = 'http://example.com/index.php/test/page/'; 
base_url This is the full URL to the controller class/function containing your pagination. In the example above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can re-route your URI if you need a different structure. 
+0

는 질문을 읽고 - 내가 그것을보고했습니다. – t0mgs

관련 문제