0
votes

I have problem with cakephp pagination if i pass GET url

everything work fine if i don't add use GET param

like this page #2

domain/imsystem/admin/remuneration_points/#admin/remuneration_points/index/page:2

but when i add GET param the like become this

domain/imsystem/admin/remuneration_points/#imsystem/admin/remuneration_points/index/page:2?Employee_name=&Employee_branch_id=1&Employee_departement_id=1

it come which extra 'imsystem', how to remove this? for the $paginator->options($opt);

this is for normal url

$opt['url'] = '#admin/'.$this->params['controller'].'/'.str_replace($this->params['prefix'].'_', '', $this->params['action']);

if with GET param

i set

$opt['url'] = $args;

which is array

Array ( [url] => Array ( [?] => Employee_name=&akhir_tanggal=&Employee_branch_id=1&Employee_departement_id=1 )

)

2
i have read it, still don't got it, can you give more details? - Surya Wono
don't get your Query that why i share you link.. - Harman
i have add extra field, pls read it - Surya Wono
question is not clear.....update your question with whole controller and view.. - Fazal Rasel

2 Answers

0
votes

Please verify your html urls

they proubly have something like <a href ="#imsystem/">

0
votes

It's not apparent where the second imsystem comes from as the code which is apparently responsible for defining that is in the question. However:

That won't work

Unless you're using js (in which case - you don't really need js for defining the pagination links) - if you have a url of the form:

example.com/imsystem/admin/remuneration_points/#admin/remuneration_points/index/page:2

The only thing that is seen server side is:

example.com/imsystem/admin/remuneration_points/

The url fragment only exists on the browser, which means that irrespective of the url, it will be page one with default sort/limit/order.

It's probably a good idea to setup pagination using get parameters, which will "just work" and go from there.