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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:56:35+00:00 2026-05-31T08:56:35+00:00

I am trying to find a way to create a menu in Codeigniter that

  • 0

I am trying to find a way to create a menu in Codeigniter that displays different options based on the access level of the user i.e. If they’re an admin, and editor or just a normal user. Some of their options will overlap.

I’ve considered adding an if statement to the view, but this isn’t very good MVC. I’ve also considered creating a multi-dimensional array within a controller that sets the menu options based on the user access level.

I’d really appreciate ideas and opinions.

  • 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-31T08:56:37+00:00Added an answer on May 31, 2026 at 8:56 am

    Each of your user accounts should have a set of roles, i.e. Dashboard, Sales, Payments, Products, Product Add/Edit, Product Delete, Reports, etc. (you can use Ion Auth’s groups as roles). Then you create a view which will display the menu and you will pass the logged user roles to that view. Then you go through all roles and compare them to the user roles. If the user has a role to see a specific page then you add a link to that page in the menu.

    That’s it 🙂
    Hope I helped.

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

Sidebar

Related Questions

Trying to find a more elegant way to create an int that has discrete
I am trying to find a way to create a report in BIRT that
I'm trying to find a way to create a popup screen for some user
Trying to find the best way of create an overlap/overlay layer to fill the
I'm trying to find a way to create a simple outer join without too
I've been trying to find a way to display a side-menu generated from a
I am trying to find a way to create an entry point for my
I'm trying to find a way to get the list of people that I'm
I'm trying to find a way to create a calculation from results in a
I am trying to find the best way to create a dynamic meta robots

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.