Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to pass variables through the URL when using pagination?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 256
    Comment on it

    First of all we should understand the pagination concept , so for this check the cakephp.org .

    If we want to pass the custom variables in pagination so first of all pass the variables to the view . Lets suppose we want to pass $pass .

    In the controller write this :

    $this->set('pass',$pass);

    Then in the View file write this code :

    <?php
        $this->Paginator->options(array(
            'url' => array(
                'pass' => $pass
            )
        ));
    ?>

    So if user moved from page 1 to page 2, the url arise would be somewhat alike below:

    http://localhost/cake/posts/index/pass:testString/page:2

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: