Skip to content

Instantly share code, notes, and snippets.

@takuma7
Forked from slywalker/pagination.ctp
Created August 28, 2012 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takuma7/3494513 to your computer and use it in GitHub Desktop.
Save takuma7/3494513 to your computer and use it in GitHub Desktop.
pagination element for CakePHP on twitter bootstrap
<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