I am using KnpPaginatorBundle in my Symfony2 project. Everytime I am requesting certain page of results, the result is returning to me looks like:
{
"currentPageNumber": "2",
"numItemsPerPage": 5,
"items": [ ...
]
}
As you can see currentPageNumber
is string here. How can I change type of this property to integer?
You can use standarttype casting in php (documentation)
For sample you can do it like this:
And look at this case: