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 5961373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:57:20+00:00 2026-05-22T18:57:20+00:00

How to Limit the paginate in cakephp ? Assume that i have 400 records.

  • 0

How to Limit the paginate in cakephp ?

Assume that i have 400 records.
I need to get only 25 records from 50th record to 75th record
and need to display 5 records per page.
How i can do this in paginate ?

Sample Code:

        $this->paginate = array(
                'contain'=>array('User'),
                'recursive' => 2,
                'order' => array('Profile.winning' => 'DESC'),
                'limit' =>5

            );
  • 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-22T18:57:21+00:00Added an answer on May 22, 2026 at 6:57 pm

    You can set conditions for the pagination.

    function listRecords()
      {
      $this->paginate = array(
        'conditions' => array('Model.id >=' => 50, 'Model.id <=' => 75),
        'limit' => 5
        );
      $this->paginate('Model');
      );
    

    EDIT:

    A solution from here:

    $this->paginate = array(
      'limit' => 20,
      'totallimit' => 1000
      );
    

    And then in the Model:

    public function paginateCount($conditions = null, $recursive = 0, $extra = array())
      {
      if( isset($extra['totallimit']) ) return $extra['totallimit'];
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mysql call with pagination that looks like that: $this->paginate['limit'] = 400;
I am using cakePHP 1.26. In the PostsController, I have this: $this->paginate=array('conditions'=>array('Reply.post_id'=>$id),'limit' => 1);
I have a collection of people that is paginated with will_paginate @people = Person.paginate
I have a photoblog built on CakePHP 2.0 with a data structure that looks
i have PostsController controller and in this controller i need get all user list.
I'm kind of new to cakePHP and get to the moment where i have
Whenever I need to limit shell command output, I use less to paginate the
I need to paginate on a set of models that can/will become large. The
I've read in multiple locations that GAE lifted the 1000 record limit on queries
I have 10 subscriber tables from subscriber_0 to subscriber_9, I get all the data

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.