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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:58:57+00:00 2026-06-18T03:58:57+00:00

i have to display product info either in grid view or by list view.

  • 0

i have to display product info either in “grid” view or by list “view”.

Intially i am passing a url like http://localhost/thebestbookfinder.com/viewallbooks/books/pgn/1/grid but if i click on the pagination links then my url is getting restarted to http://localhost/thebestbookfinder.com/viewallbooks/books/pgn/1 . Thus, because of this i am unable to load my view format data.
How to fix this error?

This doubt is part of my friend problem Browse the main problem link

MyContoller.php

function books()
{
    $config = array();  
    $config['base_url'] = base_url().'viewallbooks/books/pgn/';
    $config["total_rows"] = $this->Booksmodel->record_count_for_secondtopBooks('3');
    $config['uri_segment'] = 4;
    $config['per_page'] = 3;
    $config['full_tag_open'] = '<div id="pagination">';
    $config['full_tag_close'] = '</div>'; 

       $this->pagination->initialize($config);
       $page = ($this->uri->segment(4)) ? $this->uri->segment(4) : 0;

    $data["query"] = $this->Subjectmodel->get_subjects();
    $data["query1"]=  $this->Editionmodel->get_edition(); 

    $data["query2"]=$this->Booksmodel->get_all_book_list_atHomeTop('3',$config["per_page"], $page);
     $data["links"] = $this->pagination->create_links();


   //---------For getting view type and passing to the view to show data accordingly-----
    $viewType = ($this->uri->segment(5)) ? $this->uri->segment(5) : 'list';
    $data["vt"]=$viewType;
    // ----Ends here For getting view type and passing to the view to show data accordingly-----

   $this->load->view('commonfiles/booksview',$data);   
}
  • 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-06-18T03:58:59+00:00Added an answer on June 18, 2026 at 3:58 am

    Change your base_url to:

    $config['base_url'] = base_url().'viewallbooks/books/pgn/grid';
    

    and change your URL structure to:

    http://localhost/thebestbookfinder.com/viewallbooks/books/pgn/grid/1

    The page number should be the last thing in the url.

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

Sidebar

Related Questions

I have inserted a code to display product attribute in view.phptml, which works fine.
I have an SQL table like this : sales(product,timestamp) I want to display a
I have a custom block (tabbed product info) which I want to display in
In my program, I have to get product info using the product id, like
I have to display product and its description in listview/gridview,like any other eComm application.User
I have a product database and I am displaying trying to display them as
I have an image in WPF that I would like to have display different
I have quickly coded up a sort of product display thing that gets half
I'm working on the Web GUI of an appliance-like product. I have an HTML
I have a series of product divs in a grid, each of which is

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.