Right away I would say, that I read this question Doctrine2 Paginator, but it doesn\'t give me enough information regarding the title of my question.
When I used Doctrin
Or some other loop:
for ($i=0; $i < $pagesCount; $i++) {
if ($currentPage == ($i+1)) {
$pagination1 .= '- '.($i+1).'
';
}else{
$pagination1 .= '- '.($i+1).'
';
}
}