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

The Archive Base Latest Questions

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

Im new to codeigniter, and i cant seem to get my head around this.

  • 0

Im new to codeigniter, and i cant seem to get my head around this.

I have a person controller

function index()
{
    $this->load->model('person_model');

    $headData['title'] = 'Person';
    $data['records'] = $this->person_model->getAll();

    $this->load->view('header', $headData);
    //$this->load->view('db_options_view');
    $this->load->view('person_view', $data);
    $this->load->view('footer');
}

The above selects every person from my database, and my person view (www.example.com/person/) displays a table listing each persons id and their name.

The id field of each person in the table is a link to a page with information just about that person (www.example.com/person/24). Is this correct or would it need to be (www.example.com/person/view/24), with a method called view in the person controller?

Would this require a separate view as well, or could it be done with the same view?

Im sure this is pretty straightforward but I thought it would be better if i got a good answer so i can start off doing it the correct way rather than teaching myself the wrong way to do it!

  • 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:15:27+00:00Added an answer on May 22, 2026 at 6:15 pm

    This would be a controller thing, not a views. Just want to put that out there first and foremost. Secondly it would be domain.com/person/24 person being the name of the function in the controller and 24 in this case being the parameter for the function. And if done correctly you could handle it through the same controller (also note 24 in this case would be the index() functions parameter ie: index($variable)

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

Sidebar

Related Questions

i have download the new codeigniter 2.0 and put my controller,model and view files
I have found this example on StackOverflow: var people = new List<Person> { new
I'm new to CodeIgniter, and I need some help. I'd like to implement the
New to javascript/jquery and having a hard time with using this or $(this) to
I've been working on this for a while now and I can't seem to
I am brand new to Code Igniter but I can't seem to find a
I'm building an app in CodeIgniter. I have an invoice form which uses jQuery
Having a problem with image manipulation in codeigniter - it bombs when I get
In one of my new codeigniter project, one of my colleague wrote a helper
I want to create secure cf using CodeIgniter. I'm new to using CodeIgniter. 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.