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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:29:58+00:00 2026-06-08T12:29:58+00:00

How do you make a simple navigation in Code Igniter? I keep tripping up

  • 0

How do you make a simple navigation in Code Igniter? I keep tripping up on all these pseudo folders. Originally I was looking to make something that dug through a folder and grabbed all the file-names, then placed them in an array to order them into a nav bar.

Problem is, it seems that CI uses public functions for the pseudo folder in each page. Such as “public function aboutme()” would work out to xxx.xxx.xxx.xxx/index.php/[classname]/aboutme. This poses a problem for me, because when making links like test works out to xxx.xxx.xxx.xxx/[classname]/contactme.

Is there a better, dynamic way to make a nav bar without using a database? I CAN use a database, but I’m trying to learn CI and since I’m already well-versed in MySQL I wanted to find a way to do this some other way.

  • 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-08T12:29:59+00:00Added an answer on June 8, 2026 at 12:29 pm

    Maybe a custom route would help you?

    http://codeigniter.com/user_guide/general/routing.html

    I’m not sure the structure of your application, but if you are using multiple controllers, it won’t really help and there isn’t really an easy way to do it “automagically”. The best thing would be to come up with some way to manage the navigation items, such as a database (as you said).

    If you’re only using one class, you can use PHP’s get_class_methods() on the class.

    $pages = get_class_methods('classname');
    
    foreach($pages as $page)
    {
        echo anchor($page, ucfirst($page));
    }
    

    This is a very simplistic way to do it, and you’ll have to filter out private methods and the __construct method as well.

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

Sidebar

Related Questions

I am trying to make a navigation that uses simple unordered lists to list
I'm trying to make a simple navigation menu with jquery, where you hover over
Basically I want to make simple toggle program (that will be mapped to some
I'm trying to make simple website with content background combined from 3 images: top
Trying to make simple minesweeper game in python, but have one problem. I have
I need to make simple CRUD web app (i'll get paid for it), but
I am trying to make simple notepad application for learning android development. So, to
I'm trying to make simple script using jquery $post function to pass data to
Im going to make simple game with fallowing architecture: Initialization OpenWindowAndGraphics while(game_not_end) { ReadEvents
Is it generally fast enough to make simple updates synchronously? For instance with a

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.