# Problem with Paginator-\>Sort Links

**URL:** <https://discourse.cakephp.org/t/problem-with-paginator-sort-links/4722>\
**Category:** Need Help\
**Created:** [August 15, 2018, 9:06am UTC](https://discourse.cakephp.org/t/problem-with-paginator-sort-links/4722 "2018-08-15T09:06:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![heohni](https://avatars.discourse-cdn.com/v4/letter/h/ed8c4c/32.png) [@heohni](https://discourse.cakephp.org/u/heohni)\
**Post date:** [August 15, 2018, 9:06am UTC](https://discourse.cakephp.org/t/problem-with-paginator-sort-links/4722/1 "2018-08-15T09:06:47Z")

</div>

Hi,

I have this in my controller:

```
public $paginate = [
    // Other keys here.
    'maxLimit' => 12,
    'order' => ['obj_preis' => 'desc']
];

```

when I debug this in my search.ctp:

```
debug($this->Paginator->sortKey());
debug($this->Paginator->sortDir());

```

it will show me always sortDir = asc

And this results in the problem, that the  
echo $this-\>Paginator-\>sort(  
‘obj\_preis’,  
\_\_(‘Preis sortieren’),  
[‘escape’ =\> false]  
);

Link will always (!) do the sort in “desc” direction.  
I really need urgent help with that and also willing to pay for a solution/fix on this matter.

Thanks!

---

<div class="post-metadata">

**Author:** ![mesiarm](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@mesiarm](https://discourse.cakephp.org/u/mesiarm)\
**Post date:** [August 31, 2018, 8:19pm UTC](https://discourse.cakephp.org/t/problem-with-paginator-sort-links/4722/2 "2018-08-31T20:19:41Z")

</div>

First check if $paginate is took in account. Does ‘maxLimit’ and other keys works? Also you can try add model name before obj\_preis like so:

```
public $paginate = [
    // Other keys here.
    'maxLimit' => 12,
    'order' => ['YourModel.obj_preis' => 'desc']
];
```
