Closed mrsurname closed 8 years ago
:+1:
Samdark, what is this? Preliminary estimation? :)
Yes. I like the idea.
Is it possible to use such rule:
'search-vuz/<page:\d+>/<per-page>' => 'site/search-vuz',
Problem is with dash symbol in parameter per-page
This is a default URL parameter name for object to set pageSize
property of
yii\data\Pagination
So my link is /search-vuz?page=2&per-page=9
.
In order to make it pretty I've changed default parameter name for ex. to n
. And finally I've got a link search-vuz/2/9
with help of such rule
'search-vuz/<page:\d+>/<n>' => 'site/search-vuz',
Is it possible to avoid step with changing default parameter name and provide a dash as a part of parameter name?
Try escaping dash with \
.
like this?
'search-vuz/<page:\d+>/<per\-page>' => 'site/search-vuz',
It doesn't work also
Then I have no idea. Need to dig into it.
What do you think? Is it ok to write a recipe about pagination + pretty url with instruction to change pageSize URL param name? When issue solved delete this instruction.
Also is it ok to create related issue?
Yep.
Another question :) Why pull request is still open? Because you have to check code before merging?
Yes. Code, wording etc.
Merged. Will adjust later.
Thank you!
About pretty URL and pagination