CI 묻고 답하기

제목 페이지네이션(pagination) 쇼부치고 왔습니다.
글쓴이 코드이그맨 작성시각 2016/06/17 15:04:29
댓글 : 5 추천 : 0 스크랩 : 0 조회수 : 17635   RSS

참조 링크

 

http://code.tutsplus.com/tutorials/codeigniter-from-scratch-day-7-pagination--net-7023

 

 

위 링크와, 메뉴얼 보면서 살짝 고쳐보았습니다.

어때유? 아까보다 훨씬 괜찮아 졌나요?

 

 다음글 이미지 업로드 시 설정한 값보다 이미지가 클 경우 설정... (3)
 이전글 CI application 과 controller 경로... (4)

댓글

코드이그맨 / 2016/06/17 15:05:03 / 추천 0
한대승(불의회상) / 2016/06/17 15:20:12 / 추천 0
한결 나아 보이네요. ^^
코드이그맨 / 2016/06/17 15:34:27 / 추천 0

감사합니다 ㅠㅠ

다음에 만들떄는, 더 발전된 버전으로 보여드릴게요

배강민 / 2016/06/17 17:20:39 / 추천 0

참고로 TapBBS (우리 포럼)은 해당 디자인 부분을 config로 빼서 불러다가 사용합니다.

config 안에 모바일용, pc용 좀 다르게 해두었고요.

CI 페이지네이션의 디자인을 view단에서 정의로 풀수 있으면 좋겠는데, 어떻게 해봐도 안되더군요. (그 누군가는 가능할 수도 있습니다.)

그래서 그나마 직접적인 소스코드와는 분리하려고 config로 정의했습니다.

/application/config/pagination.php

 

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

//메뉴얼 참고
//http://ellislab.com/codeigniter/user-guide/libraries/pagination.html

$config['mobile'] = array();
$config['pc'] = array();

//mobile
$config['mobile']['first_link'] = FALSE;//'<<';
$config['mobile']['first_tag_open'] = '';
$config['mobile']['first_tag_close'] = "\n";

$config['mobile']['last_link'] = FALSE;//'>>';
$config['mobile']['last_tag_open'] = '';
$config['mobile']['last_tag_close'] = "\n";

$config['mobile']['next_link'] = '>';
$config['mobile']['next_tag_open'] = '';
$config['mobile']['next_tag_close'] = "\n";

$config['mobile']['prev_link'] = '<';
$config['mobile']['prev_tag_open'] = '';
$config['mobile']['prev_tag_close'] = "\n";

$config['mobile']['cur_tag_open'] = '<div data-role="button" class="ui-btn-active">';
$config['mobile']['cur_tag_close'] = '</div>'."\n";

$config['mobile']['num_tag_open'] = '';
$config['mobile']['num_tag_close'] = "\n";

$config['mobile']['anchor_class'] = ' data-role="button" data-ajax="false" ';

//pc
$config['pc']['first_link'] = '<<';
$config['pc']['first_tag_open'] = '<li><span>';
$config['pc']['first_tag_close'] = '</span></li>';

$config['pc']['last_link'] = '>>';
$config['pc']['last_tag_open'] = '<li><span>';
$config['pc']['last_tag_close'] = '</span></li>';

$config['pc']['next_link'] = '>';
$config['pc']['next_tag_open'] = '<li>';
$config['pc']['next_tag_close'] = '</li>';

$config['pc']['prev_link'] = '<';
$config['pc']['prev_tag_open'] = '<li>';
$config['pc']['prev_tag_close'] = '</li>';

$config['pc']['cur_tag_open'] = '<li class="active"><span>';
$config['pc']['cur_tag_close'] = '</span></li>';

$config['pc']['num_tag_open'] = '<li>';
$config['pc']['num_tag_close'] = '</li>';

$config['pc']['anchor_class'] = '';

//EOF



 

kaido / 2016/06/17 17:35:36 / 추천 0

가능하지 않나... 생각도 듭니다

라는 말을 했다가 만들라고 할거 같아서 전 침묵으로 답변 합니다.