You can do it by overriding default pagination template. Check Templates
part of the official documentation:
https://github.com/KnpLabs/KnpPaginatorBundle/blob/master/Resources/doc/templates.md
for example:
Tell KnpPaginatorBundle to load your template for rendering pagination, add these lines of code to config.yml:
knp_paginator:
template:
pagination: YourBundle::pagination.html.twig
And copy default pagination template code to your template in src/YourBundle/Resources/views/pagination.html.twig
. You can get the code here: