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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:30:03+00:00 2026-05-30T19:30:03+00:00

I am using the codeigniter pagination library to page my search results. I am

  • 0

I am using the codeigniter pagination library to page my search results. I am using a limit and an offset to generate the results.

I would like to know how, apart from in the pagination links, echo the number of the page the user is currently viewing.

For example;

You are currently viewing page X out of Y results.

How is this possible??

  • 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-30T19:30:04+00:00Added an answer on May 30, 2026 at 7:30 pm

    You could extend the Pagination class (system/libraries/Pagination.php).

    Create a file called MY_Pagination.php and put it in application/libraries/

    Add this code to your extend pagination class;

    class MY_Pagination extends CI_Pagination {
    
        public function __construct() {
            parent::__construct();
        }
    
        public function current_place() {
            return 'You are currently viewing page '.$this->cur_page.' out of '.ceil(($this->total_rows/$this->per_page)). 'results';
        }
    }
    

    Don’t forget to make sure the class extension prefix is set correctly to MY_ in the config.php (about line 109)

    Then you can access it in your controller like;

    $current = $this->pagination->current_place();
    

    Which you can pass into your view.

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

Sidebar

Related Questions

Is there anyway to avoid using LIMIT $page,$offset when retrieving rows in codeigniter pagination?
I'm using codeigniter to create a search page. I'd like to rewrite a GET
I am trying to build a Search with Pagination in Codeigniter and would love
I am using CodeIgniter, and in one of my models I would like to
I am using codeigniter and its pagination class. It works perfectly and it looks
I am using CodeIgniter to pass some parameters to my PHP page through $_POST
I'm using CodeIgniter (because it's awesome) and I have something like: <?php echo anchor(/,
I am using codeigniter. My products page shows all the products we have and
Using Codeigniter, any numeric data returned from my MySQL database is returned as strings.
Using CodeIgniter, I am trying to place several images onto my view page as

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.