Diễn đàn Nhật Bản - diendannhatban.info

NHÀ PHÁT TRIỂN - DEVELOPERS - 技術開発 => FRAMEWORK - SDK => CakePHP => Tác giả chủ đề:: admin trong Thứ năm, 5/01/2017, 06:36:40 am

Tiêu đề: Tạo button phân trang pagination với html helper của CakePHP 2
Gửi bởi: admin trong Thứ năm, 5/01/2017, 06:36:40 am
Code: Bạn không thể xem liên kết này. Đăng ký hoặc Đăng nhập
<?php
echo $this->Paginator->numbers(array(
    
'before' => '<div class="pagination"><ul>',
    
'separator' => '',
    
'currentClass' => 'active',
    
'tag' => 'li',
    
'after' => '</ul></div>'
));
?>


Code: Bạn không thể xem liên kết này. Đăng ký hoặc Đăng nhập
<div class="pagination pagination-large">
    <ul>
            <?php
                
echo $this->Paginator->prev(__('prev'), array('tag' => 'li'), null, array('tag' => 'li','class' => 'disabled','disabledTag' => 'a'));
                echo 
$this->Paginator->numbers(array('separator' => '','currentTag' => 'a''currentClass' => 'active','tag' => 'li','first' => 1));
                echo 
$this->Paginator->next(__('next'), array('tag' => 'li','currentClass' => 'disabled'), null, array('tag' => 'li','class' => 'disabled','disabledTag' => 'a'));
            
?>

        </ul>
    </div>

Tham khảo
https://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#creating-page-number-links
https://gist.github.com/jruzafa/5302941
http://stackoverflow.com/questions/14346182/bootstrap-pagination-with-cakephp-pagination-helper