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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:27:33+00:00 2026-06-01T16:27:33+00:00

Rather a basic question, though i’m a bit confused with the architecture. I am

  • 0

Rather a basic question, though i’m a bit confused with the architecture.
I am programming a website using Yii framework.
There is a SiteController and AdminController (built not by me).
All the site administration is in AdminController, and the user interaction in SiteController.
I know it is not correct as it is not model-based.

Now, I want to implement user registration. The user can signup and administrator can change his properties.
Is it better to build UserController or manage all the above in the existing controller (not breaking previous logic)?

  • 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-01T16:27:35+00:00Added an answer on June 1, 2026 at 4:27 pm

    By MVC standards its best to split controllers by function groups.

    Auth Controller

    handles authentication/registration/deletion. Sets session vars for logins which all other controllers check first thing.

    function register(){
    }
    function logout(){
    }
    function edit(){
    }
    function login(){
    }
    

    Admin Controller

    handles all administrative tasks

    User Controller

    handles all user tasks. Maybe editing profiles, or posting to a personal blog?

    Front Controller

    handles all public facing tasks, displaying non auth based pages etc.


    Unrelated, CodeIgniter Example

    I use this methodology in my CI projects. This information will vary from Yii framework but it gives you a glimpse of a proper MVC setup.

    I have core controllers such as:

    application/core/FRONT_Controller.php
    this controller extends CI_Controller and handles all the setup of my pub facing pages. All of my public facing controllers extend FRONT_Controller instead of CI_Controller.

    application/core/USER_Controller.php
    this controller handles all of my users authentication.

    application/core/ADMIN_Controller.php
    this controller does preliminary checks, again all of my admin based controllers extend this controller so the authentication fires off right away… IE:

    if (!$this->tank_auth->is_logged_in()){
            redirect(site_url('/user/login/'));
        }else{
            $this->data['user'] = array(
                'user_id' => $this->tank_auth->get_user_id(),
                'username' => $this->tank_auth->get_username(),
                'emailAddress' => $this->tank_auth->get_email(),
                'firstname' => $this->tank_auth->get_firstname(),
                'lastname' => $this->tank_auth->get_lastname(),
                'userlevel' => $this->tank_auth->get_userlevel(),
                'avatar' => $this->tank_auth->get_avatar(),
                'last_login' => $this->tank_auth->get_last_login()
            );
        }
    

    application/controllers/blog.php:

    class Categories extends ADMIN_Controller{
    
    function __construct(){
        parent::__construct();
    
    } #end constructor function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm relatively new to SVN and have a rather basic question. I have several
I think my question is rather basic, but I can't find an answer: I
I am completely new to MATLAB.This may be a rather basic question. Given numerical
So I have a rather basic javascript problem which I have been slamming my
Know this might be rather basic, but I been trying to figure out how
What I'm trying to do is rather basic, but I might have my facts
rather than using a textnode to show content im trying to figure out how
Rather a simple question. But the implications are vast. Over the last few weeks
Rather Trivial Question. So I tried to do this: if (array[0]==some_string) where array is
Rather new to REST and Jersey, and I'm trying out some basic examples. I've

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.