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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:44:01+00:00 2026-06-17T07:44:01+00:00

I have a problem with the organization of views on CodeIgniter. Project: Create a

  • 0

I have a problem with the organization of views on CodeIgniter.

Project: Create a simple web application that permits to manage a library(bookcase).

I created 3 models : Member, Categories, Books with their respective controllers.

I implemented the Member model with its controller.

In the member_controller we have:

public function login(){

$this->load->helper('form');
$this->load->helper('email');
$this->load->library('form_validation');

$mail = $this->input->post('mail');
$pass = $this->input->post('pass');

$data['mail'] = $mail;
$data['pass'] = $pass;


$this->form_validation->set_rules('mail', 'mail', 'required');
$this->form_validation->set_rules('pass', 'pass', 'required');

if ($this->form_validation->run() === TRUE)
{

$result=$this->membre_model->login($mail,$pass);

if($result==TRUE){

$this->load->view('templates/header.php');
$this->load->view('membre/logged',$data);
$this->load->view('templates/footer.php');


}

Once user is logged, I want to show all existing categories he previously created(so get them from the database).

  • How can I do that?
  • Do I have to call a function of the category controller in the login function of the member controller?
  • Do I have to load the category view from the Login function?
  • Do I have to build the site from just one controller(the member controller)?
  • How to build the webapp with differents views of differents controllers?

Finally, the thing I don’t get is how the different controller communicate between them.

  • 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-17T07:44:02+00:00Added an answer on June 17, 2026 at 7:44 am

    How can I do that?

    You would have to add an exception when loading each page that will redirect user based on their login status. In other words, if user is logged in, bring him to the application. If user does not exist, redirect him to the registration page.

    This can be done by verifying if the user is logged in based on stored session values. If this session is stored than you can let the user view the page. Here is a great tutorial explaning a simple Login system for Codeigniter.

    http://www.codefactorycr.com/login-with-codeigniter-php.html

    In my opinion, I usually use an Authentication library to simplify the Login system for my application. I would use Ion Auth, it has a great documentation explaning all the functions you can use.

    Do I have to call a function of the category controller in the login function of the member controller?

    You can simply use the category controller as you would normally. You would change the pages information or redirect the user out based on the session information stored in their browser.

    Do I have to load the category view from the Login function?

    You would load the category view from the category controller. The login controller would redirect the the user to the category controller after the login is performed.

    Do I have to build the site from just one controller(the member controller)?

    No, you can have as many controllers as you like.

    How to build the webapp with differents views of differents controllers?

    A controller would represent a section of your site. This controller would load multiple views for different things. Here is a great little tutorial explaning the MVC worklow. This will help you understand the process.

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

Sidebar

Related Questions

I have problem with show or hide form in Window Form Application. I start
Intro I have an object @organization that has_many :quick_facts Basically, I want to produce
I have an application divided in subpackages, just for personal organization: com.myname.myapp | `-
In my domain I have a many-to-many relationship. The problem is that GORM forces
I have some working Javascript that manipulates the some DOM elements. The problem is,
Here, I have a problem in searching record in Postgresql DB in RoR Application.
I just started using code contracts in my project. However, I have a problem
I have configured maven with Bamboo and have a local repository that contains organization
Consider this simple problem: Suppose I have a 1x4 array. I have to add
I have a Scalatra project with the following build.sbt organization := com.example name :=

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.