CI 묻고 답하기

제목 페이지 네이션 질문입니다.
글쓴이 fafev 작성시각 2011/12/19 16:03:35
댓글 : 2 추천 : 0 스크랩 : 0 조회수 : 16879   RSS

if  ($this->prev_link !== FALSE AND $this->cur_page != 1)
  {
   if ($this->use_page_numbers)
   {
    $i = $uri_page_number - 1;
   }
   else
   {
    $i = $uri_page_number - $this->per_page;
   }

   if ($i == 0 && $this->first_url != '')
   {
    $output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
   }
   else
   {
    $i = ($i == 0) ? '' : $this->prefix.$i.$this->suffix;
    $output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$i.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
   }

  }

 $pagination_config['num_links'] = 2;

이렇게 설정하면 앞뒤로 페이지가 2개씩 붙어서
5개가 뜨는데요

페이지가 1페이지일때는 앞에 2개가없어서 3개가뜨고
2페이지는 앞에하나있어서 4개가뜨는데요

1 2페이지와 마지막페이지,마지막전페이지 까지 전부다 5개가 뜨게 설정할수있는 방법좀 물어보려 글남깁니다..

if문으로 1페이지일경우 2페이지일경우는 해결할수있겠는데
마지막페이지와 그전페이지가 문제네요;;
페이지가 유동적이라;;


 다음글 몇일 눈으로 만 레퍼런스 보고 강좌보고 한번 아주 기본... (2)
 이전글 IE 에서만 Session 값을 읽어오지 못합니다. (4)

댓글

fafev / 2011/12/19 16:49:28 / 추천 0
검색하니 나오네요;; 검색을 생활화해야겠군요...

my_pag....php 에서 $start,$end 위에 붙여서 해결했습니다.

http://codeigniter-kr.org/include/syntaxhighlighter/styles/wrapping.png) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-size: 1em !important; display: block !important; text-indent: -1.5em !important; background-position: 0px 1.1em !important; background-repeat: no-repeat no-repeat !important; ">if($this->cur_page <  $this->num_links+1 && $num_pages > 2*$this->num_links) $end = 2*$this->num_links + 1;
8.http://codeigniter-kr.org/include/syntaxhighlighter/styles/wrapping.png) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-size: 1em !important; display: block !important; text-indent: -1.5em !important; background-position: 0px 1.1em !important; background-repeat: no-repeat no-repeat !important; ">if($this->cur_page + $this->num_links >  $num_pages$start $num_pages - 2*$this->num_links +1;
변종원(웅파) / 2011/12/19 16:52:14 / 추천 0
포럼에서 검색해보시면 그 부분 해결한 팁이나 다른 페이징 올라와있는 것 있습니다.