PHPackages                             josbeir/cakephp-paginator-sortmap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. josbeir/cakephp-paginator-sortmap

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

josbeir/cakephp-paginator-sortmap
=================================

Paginator with support for custom mappable multi sortable sort keys

0.1(7y ago)0342MITPHP

Since Jul 13Pushed 7y ago1 watchersCompare

[ Source](https://github.com/josbeir/cakephp-paginator-sortmap)[ Packagist](https://packagist.org/packages/josbeir/cakephp-paginator-sortmap)[ RSS](/packages/josbeir-cakephp-paginator-sortmap/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

CakePHP Paginator with sortmaps
===============================

[](#cakephp-paginator-with-sortmaps)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)[![Build Status](https://camo.githubusercontent.com/8d4acfe4caed14efad3b0ee4aa4f860c2c588a5c168aa865269dae0c8e5ce04d/68747470733a2f2f7472617669732d63692e6f72672f6a6f73626569722f63616b657068702d706167696e61746f722d736f72746d61702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/josbeir/cakephp-paginator-sortmap)

This plugin is a modified version of the built in cakephp paginator. Instead of using `sortWhitelist` there's now a `sortMap` option where you can define mappings of fields to sort.

This plugin was created as a proof of concept after some discussion on slack and in an old [ticket](https://github.com/cakephp/cakephp/issues/10028#issuecomment-272812357) on the main cake repo.

This plugin also makes pagination work correctly with plugins like Cakephp\\Elasticsearch.

Installation
------------

[](#installation)

The usual:

`composer require josbeir/cakephp-paginator-sortmap`

Then enable the plugin by adding it to your Application::bootstrap()

`$this->addPlugin('Josbeir/Paginator');`

### Controller example

[](#controller-example)

```
