I’ve been using the built in pagination in CakePHP 1.2-beta a lot lately and I must say it’s freaking awesome. My one oh so minor grievance is that it doesn’t “remember” where you were if you navigate off the page. For example many times I’ll be paging through a sorted list of records and want to edit a particular one. After I edit and save I’m dropped back to the index with the default sorting on page 1.

I Googled around a bit and skimmed through the pagination code, but didn’t see a quick way to turn this type of functionality on. So I wrote a quick component that keeps the sort/page in the session and re-applies it. This is all done automatically by just including the component in your controller.

You can download the component here.

I’ll probably submit it to the CakePHP Bakery soon, but was hoping to get some feedback first.

Popularity: 90% [?]