Log message #4124290

# At Username Text
# Mar 12th 2018, 18:05 birdy247 Hey @savant
# Mar 12th 2018, 16:21 dorxy me neither
# Mar 12th 2018, 16:14 neon1024 In all honesty I’ve only ever needed to pass a url into the Paginator when I’m using routing params, to display different ‘types’ of things in a single index template
# Mar 12th 2018, 16:03 dereuromark raul338: true, in that case the id is not a filter for pagination, but already a main filter
# Mar 12th 2018, 16:02 dorxy you're welcome :slightly_smiling_face: you'll get there! :)
# Mar 12th 2018, 16:02 learningcake ;)
# Mar 12th 2018, 16:02 learningcake Let me try this out. Mentor Dereuromark, Mentor Neon1024, Mentor Dorxy and Mentor Raul338, Mentor Admad. Thank you. Been learning cakephp3 for close to 6months now and this is my first project using cakephp3
# Mar 12th 2018, 16:02 raul338 if your current url is /stores/63, next page is /store/63?page=2 it make no sense to make it /store?page=2
# Mar 12th 2018, 16:00 dorxy @dereuromark thanks for the explanation, good URLs ftw ;)
# Mar 12th 2018, 15:59 neon1024 It should yes, you’re right
# Mar 12th 2018, 15:59 raul338 it should work out of the box
# Mar 12th 2018, 15:59 neon1024 Would generate links like `example.com/examples/foo/bar?page=3` for example. Depending on your routing config obviously
# Mar 12th 2018, 15:59 raul338 but the paginator keeps query data and url structrure
# Mar 12th 2018, 15:58 neon1024 The paginator has an option of url, which will form the base of the url being built. So you can pass in your url with the params you need to include in the pagination. `$this->Paginator->options(['url' => ['controller' => 'Examples', 'action' => 'index', 'foo' => 'bar']])`
# Mar 12th 2018, 15:58 learningcake raul338, not totally hide it if I can get it to work showing the id in the pagination. I just did a search method that makes use of GET and pagination works fine
# Mar 12th 2018, 15:58 dereuromark the bottom line is: a filter as session is a usability killer. instead you should have good URLs by default.
# Mar 12th 2018, 15:57 dereuromark dorxy: the post is not necessary if it doesnt come from a form - as a normal link it is fine as get. thats part of prg.
# Mar 12th 2018, 15:57 neon1024 https://github.com/cakephp/cakephp/blob/master/src/View/Helper/PaginatorHelper.php#L53
# Mar 12th 2018, 15:56 learningcake @neon1024, can you explain more what you meant by pass the url into the helper
# Mar 12th 2018, 15:56 raul338 i don't understand why learningcake want to hide the store id in the pagination
# Mar 12th 2018, 15:56 neon1024 It prevents resubmission
# Mar 12th 2018, 15:55 learningcake was thinking session
# Mar 12th 2018, 15:55 dorxy why post pagination?
# Mar 12th 2018, 15:55 dorxy although I don't completely understand how that would be applicable here
# Mar 12th 2018, 15:55 learningcake hmm. thank you Geniuses
# Mar 12th 2018, 15:55 dorxy TIL :slightly_smiling_face: thanks
# Mar 12th 2018, 15:54 neon1024 Totally agree!
# Mar 12th 2018, 15:54 dereuromark neon1024: the idea is the same, you can just use that and do it on your own using that idea, but session is never the right solution here :slightly_smiling_face:
# Mar 12th 2018, 15:54 neon1024 Post Redirect Get, https://en.wikipedia.org/wiki/Post/Redirect/Get
# Mar 12th 2018, 15:53 dereuromark dorxy: https://github.com/FriendsOfCake/search#component
# Mar 12th 2018, 15:53 neon1024 Well, although I agree, it’s a bit heavy for what’s needed. Personally I would pass the url into the helper
# Mar 12th 2018, 15:53 dorxy @dereuromark what is prg?
# Mar 12th 2018, 15:53 learningcake okay
# Mar 12th 2018, 15:53 dereuromark I just told you: query string, prg, search plugin
# Mar 12th 2018, 15:52 learningcake please, how do I do it the right way,
# Mar 12th 2018, 15:52 dereuromark do it the right way, hacking it here only brings in bugs and usability issues
# Mar 12th 2018, 15:52 dereuromark he should look into prg pattern and foc/search plugin instead
# Mar 12th 2018, 15:52 learningcake yes
# Mar 12th 2018, 15:52 raul338 in that case the pagination helper should keep the id
# Mar 12th 2018, 15:51 raul338 I think learningcake is trying to make a pagination inside a view, like /stores/63?page=2
# Mar 12th 2018, 15:51 dorxy is the reason you're writing it to the session because it is not persisted between pagination? or because you wish to access it for other requests as well?