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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:41:32+00:00 2026-06-16T02:41:32+00:00

I am still learning Extjs and mvc so I have a design question that

  • 0

I am still learning Extjs and mvc so I have a design question that I am sure someone can answer for me. My question is:

I have 2 controllers that handle two different views. Either of the two controllers are called to render the correct view based on the type of user. So in my case if the user is admin then they will get the admin view based on credentials and if the person a standard user then they will get the standard view. Should the decision logic be placed in the app.js or should there be another controller that decides which controller to call?

One way I am thinking about:

controller for admin

Ext.define('adminController', {

      // handles admin 
})

controller for standard user

Ext.define('standardController', {

      // handles standard 
})

App.js

   Ext.application({
   name: 'MTK',
   autoCreateViewport: true,

     if(admin) {
       controllers: ['adminController']
     }
     else(std){
       controllers: ['standardController']
     }
});

Another idea:

controller for admin

Ext.define('adminController', {

    // handles admin 
})

controller for standard user

Ext.define('standardController', {

    // handles standard
})

main controller

Ext.define('mainController', {

   if(admin){
      call adminController
   } 
   else(std){
      call standardController
   }
})
  • 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-16T02:41:33+00:00Added an answer on June 16, 2026 at 2:41 am

    I wouldn’t do (or at least too much of it) this in the frontend. I guess you should be able to know the user role the time the user is logging in so.

    For me I do it this way, but I must say I have a much more complex ACL and I won’t bother a user with modules or views where the backend will refuse any access to.

    I am using these two approaches:

    • reload/redirect to the application view (backend!) after a successful login. The server knows what to hand-back by the user session
    • return a configuration after a successful login witch contains information what to require next (this could be just a controller or some more classes)

    Both approaches result in less code, faster loading’s and easier debugging

    I hope this points you in the right direction.

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

Sidebar

Related Questions

I´m still learning my way around MVC programming and have one question for you
I'm still learning PHP Regex so I'm hoping someone can help me with what
I'm still learning what hibernate can do and this time i'm trying something that
I'm still learning Backbone but it is my understanding that it should handle updating
Still learning MySQL, so bear with me. So I have two tables: leads, which
Sorry still learning Yii so newbie question. I have a site im converting over
Still learning magento coding. I wonder is there a way I can print out
Still learning JSP Web Applications here. I have been doing this for a while
I'm still learning the ropes for Entity expressions, and I have this SQL query
I'm still learning CSS, so please pardon me if this is something that 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.