Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7443691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:22:18+00:00 2026-05-29T11:22:18+00:00

Cakephp 2.0 Pagination issue. How to pass arguments in pagination link? I passed the

  • 0

Cakephp 2.0 Pagination issue. How to pass arguments in pagination link?

I passed the arguments like

 $this->Paginator->options(array('url' =>  $this->request->query));

but after 2 nd page its not working .

On first page submitted values are coming in $this->request->query but from second page
its coming in $this->params->named but it needs to come in $this->request->query

My Pagination part from view file:

<div class="paging">
    <?php
    $this->Paginator->options(array('url' =>  $this->request->query));
        echo $this -> Paginator -> prev('< ' . __('Previous'), array(), null, array('class' => 'prev disabled'));
        echo $this -> Paginator -> numbers(array('separator' => ''));
        echo $this -> Paginator -> next(__('Next') . ' >', array(), null, array('class' => 'next disabled'));
    ?>

while printing params on first page :

[query] => Array
    (
        [first_name] => 
        [username] => an
        [email] => 
        [dob] => Array
            (
                [year] => 
                [month] => 
                [day] => 
            )

    )

while printing params on second page :

    [named] => Array
            (
                [first_name] => 
                [username] => an
                [email] => 
                [dob%5Byear%5D] => 
                [dob%5Bmonth%5D] => 
                [dob%5Bday%5D] => 
                )
[query] => Array
    (
        [/admin/users/index/first_name:/username:an/email:/dob] => Array
            (
                [year] => 
            )

    )
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:22:18+00:00Added an answer on May 29, 2026 at 11:22 am

    I added the following code in View file and now every thing is working fine. in all pages param values are coming in request->query

    $url = $this->params['url'];
    
        unset($url['url']);
        if(isset($this->request->data) && !empty($this->request->data)) {
            foreach($this->request->data[$model_name] as $key=>$value)
                $url[$key] = $value;
        }
        $get_var = http_build_query($url);
    
        $arg1 = array();
        $arg2 = array();
        //take the named url
        if(!empty($this->params['named']))
            $arg1 = $this->params['named'];
    
        //take the pass arguments
        if(!empty($this->params['pass']))
            $arg2 = $this->params['pass'];
    
        //merge named and pass
        $args = array_merge($arg1,$arg2);
    
        //add get variables
        $args["?"] = $get_var;
        $this->Paginator->options(array('url' =>  $args)); 
    

    And in Controller action method I added the following

        $args = $this->params['url'];
        unset($args['url']);
        if(isset($args['submit'])) 
            unset($args['submit']);
        if(!empty($this->request->data)){
            foreach($this->data['User'] as $key=>$value)
                $args[$key] = $value;
        }else{
            foreach($args as $key=>$value)
                $this->request->data['User'][$key] = $value;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using CakePHP 1.3 there are named parameters in the URL like .../name:value/... These are
I have created a temporary table using cakephp $this->Model->query() and inserted some records using
In CakePHP, it seems like a lot of functions can take their arguments as
In CakePHP 2 I use @ ichikaway 's MongoDB plugin like this: public $default
I need a custom query pagination in CakePHP 1.2. I have a reviews model
I'm new to cakephp...and I have a page with a url this: http://localhost/books/filteredByAuthor/John-Doe so
In cakephp, I used $rNo array in WHERE clause. $rooms =$this->find('all',array( 'conditions'=>array(NOT=>array('Room.id'=>$rNo)), 'group'=>array('Room.room_type_id'))); Now,
In CakePHP is it possible to set the options you pass to the Form
cakephp acl component make roles like this: admin add_post delete_post edit_post view_post add_link delete_link
CakePHP URL query parameters are not done in a standard fashion e.g. the params

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.