Skip to content

Instantly share code, notes, and snippets.

@takuma7
Forked from slywalker/pagination.ctp
Created August 28, 2012 02:53
Show Gist options
  • Select an option

  • Save takuma7/3494513 to your computer and use it in GitHub Desktop.

Select an option

Save takuma7/3494513 to your computer and use it in GitHub Desktop.
pagination element for CakePHP on twitter bootstrap
<?php
/*
* pagination number element for CakePHP ON TWITTER BOOTSTRAP!
* created by TaKUMA7
* 28 Aug. 2012
*/
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',
)
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment