-
-
Save takuma7/3494513 to your computer and use it in GitHub Desktop.
pagination element for CakePHP on twitter bootstrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="pagination"> | |
<ul> | |
<?php | |
echo $this->Paginator->prev('«', | |
array( | |
'tag' => 'li', | |
'class' => 'prev', | |
), | |
$this->Paginator->link('«', array()), | |
array( | |
'tag' => 'li', | |
'escape' => false, | |
'class' => 'prev disabled', | |
) | |
); | |
echo preg_replace( | |
'/<li class="active">(\d+)<\/li>/', | |
'<li class="active"><a href="#">$1</a></li>', | |
$this->Paginator->numbers(array( | |
'tag' => 'li', | |
'currentClass' => 'active', | |
'separator' => null, | |
)) | |
); | |
echo $this->Paginator->next('»', | |
array( | |
'tag' => 'li', | |
'class' => 'next', | |
), | |
$this->Paginator->link('»', array()), | |
array( | |
'tag' => 'li', | |
'escape' => false, | |
'class' => 'next disabled', | |
) | |
); | |
?> | |
</ul> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment