개발자 인생/그누보드5

page_insertbefore

잘나가는개발자 2018. 7. 4. 10:30
728x90
반응형
SMALL

page_insertbefore


string page_insertbefore(string $paging_html, string $insert_html)

페이징 코드의 <nav><span> 태그 다음에 코드를 삽입


경로

lib/common.lib.php


인수

$paging_html

페이지 HTML

$insert_html

추가 HTML


예제

$write_pages = '
<nav class="pg_wrap"><span class="pg"><span class="sound_only">열린</span><strong class="pg_current">1</strong><span class="sound_only">페이지</span>
<a href="/test.php?&amp;page=2" class="pg_page">2<span class="sound_only">페이지</span></a>
<a href="/test.php?&amp;page=3" class="pg_page">3<span class="sound_only">페이지</span></a>
<a href="/test.php?&amp;page=4" class="pg_page">4<span class="sound_only">페이지</span></a>
<a href="/test.php?&amp;page=5" class="pg_page">5<span class="sound_only">페이지</span></a>
<a href="/test.php?&amp;page=6" class="pg_page">6<span class="sound_only">페이지</span></a>
<a href="/test.php?&amp;page=7" class="pg_page">7<span class="sound_only">페이지</span></a>
<a href="/test.php?&amp;page=7" class="pg_page pg_end">맨끝</a>
</span></nav>';
$write_pages = page_insertbefore($write_pages, '<a href="'.$prev_part_href.'" class="pg_page pg_prev">이전검색</a>');

echo $write_pages;

// Output
<nav class="pg_wrap"><span class="pg"><a href="" class="pg_page pg_prev">이전검색</a>
<span class="sound_only">열린</span><strong class="pg_current">1</strong><span class="sound_only">페이지</span>
<a href="/test.php?&amp;page=2" class="pg_page">2<span class="sound_only">페이지</span></a>
<a href="/test.php?&amp;page=3" class="pg_page">3<span class="sound_only">페이지</span></a>
<a href="/test.php?&amp;page=4" class="pg_page">4<span class="sound_only">페이지</span></a>
<a href="/test.php?&amp;page=5" class="pg_page">5<span class="sound_only">페이지</span></a>
<a href="/test.php?&amp;page=6" class="pg_page">6<span class="sound_only">페이지</span></a>
<a href="/test.php?&amp;page=7" class="pg_page">7<span class="sound_only">페이지</span></a>
<a href="/test.php?&amp;page=7" class="pg_page pg_end">맨끝</a>
</span></nav>


728x90
반응형
LIST

'개발자 인생 > 그누보드5' 카테고리의 다른 글

goto_url  (0) 2018.07.10
print_r2  (0) 2018.07.09
get_paging  (0) 2018.07.03
get_microtime  (0) 2018.07.02
그누보드 설치 환경 및 설치 방법  (1) 2018.07.01