I'm trying to make pagination for a listing page, and I'm having problems setting default value for $page with getParam method from dispatcher.
The URL is like this : (http://www.example.com/category/subcategory/page_number_here)
This is how I get page param from dispatcher
$page = $this->dispatcher->getParam('page', 'int', 1);
the problem is that when I put letters only (or nothing at all) for page, it doesn't set $page with 1 as I expect it to do, it sets it with an empty string.
Am I doing something wrong, is there something that I got it wrong on how it should work?
Thanks.