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

  • Home
  • SEARCH
  • 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 931237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:28:02+00:00 2026-05-15T20:28:02+00:00

I am using cakePHP 1.26. In the PostsController, I have this: $this->paginate=array(‘conditions’=>array(‘Reply.post_id’=>$id),’limit’ => 1);

  • 0

I am using cakePHP 1.26.

In the PostsController, I have this:

$this->paginate=array('conditions'=>array('Reply.post_id'=>$id),'limit' => 1);
$w = $this->paginate($this->Post->Reply); 
$this->set('views', $w);

And in the view.ctp, I have this:

  <table><tr><td>
        <?php echo $paginator->numbers(); ?>
        <?php
            echo $paginator->prev('Previous', null, null);
            echo $paginator->next(' Next', null, null);?>
     </td></tr></table>

And when I pressed the “Next” link, a wrong URL was shown:
http://localhost:8080/post/view/page:2

The correct URL should be
http://localhost:8080/post/view/2/page:2

The ID referring the Post is missing after /post/view/

Could you help me fix the problem please?

I added this to the view.ctp:
$paginator->options(array(‘url’ => $this->passedArgs));

Now the Next and Previous links are corrected, but the
numbers in between the Next and Previous links are still incorrect.

Here is what the Previous and Next links llok like afterwards:
http://localhost:8080/post/view/2/page:2

But the links representing the numbers 1|2|3|4|5 are not changed yet:
http://localhost:8080/post/view/page:2

Any ideas?

Edit reason:
OK,
I altered my code and got a new answer for the question:
Here is the code in my view.ctp file:

<?php
    $paginator->options(array('url' => '../view/'.$postid));
    echo $paginator->numbers();
    echo $paginator->prev('Previous', null, null);
    echo $paginator->next(' Next', null, null);    
?> 
  • 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-15T20:28:03+00:00Added an answer on May 15, 2026 at 8:28 pm

    Near the bottom of this manual page it explains what you must do to have your arguments included in the pagination links.

    http://book.cakephp.org/view/166/Pagination-in-Views

    The CakePHP manual is your friend!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 526k
  • Answers 526k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you test via URL like 'file:///' , Chrome will… May 16, 2026 at 10:25 pm
  • Editorial Team
    Editorial Team added an answer Why do you want to do that? Isn't it a… May 16, 2026 at 10:25 pm
  • Editorial Team
    Editorial Team added an answer I'm not sure this is the cause, but you can… May 16, 2026 at 10:25 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Using cakephp, I have a generic address table, which I want to link to
Using CakePHP: I have a many-to-one relationship, let's pretend it's many Leafs to Trees.
I am using CakePHP 1.3. I have successfully created an Indeed DataSource and am
I'm using cakephp with this vendor: oauth_consumer.php It requires OAuth PHP library oauth.php Inside
I'm using CakePHP 1.2 and I'm just wondering if there is any side affect
I am new to cakephp and have been working through the Apress book Beginning
Using cakephp: I am trying to update customer information and the address the customer
Using cakePHP my goal is to combine the index view of two or more
Using CakePHP (On PHP 5.2.6) I do a list query on a table which
I recently downloaded cakephp-1.3.4. I set it up on my web server. I followed

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.