Jump to content

Hello,

 

I'm starting to get a hell of a lot controllers, is there a good way to organize them?

 

Currently I have

 

Controllers

  - Admin

    - AdminController

  - User

    -UserController

 

and that starts to get hard to work with but it works.

 

I found this on stackoverflow but it dident work but if it does in another way this would help alot.

https://stackoverflow.com/a/12775777

Quote
 

Convert / into _. So your controllers/user/permission.php controller would be


class User_Permission_Controller

UPDATE:

You also have to route to the controller changing _ to . So route similar to


Route::get('/', 'user.permission@index');

You can see more details on it here. http://codehappy.daylerees.com/using-controllers

 

Back-end developer, electronics "hacker"

Link to comment
https://linustechtips.com/topic/820198-laravel-mvc-organizing-controllers/
Share on other sites

Link to post
Share on other sites

1 hour ago, Cruorzy said:

You want to put the controllers in Directory's / sub directory's?

Or actually something more?

Let's say I have 2 games with settings (this is just to try make a point)

 

so they both need a controller named SettingsController, I could just do GamenameSettingsController and have it under the folder Settings/Gamename/<here>

But are there any better ways of organizing them?

 

Back-end developer, electronics "hacker"

Link to post
Share on other sites

7 hours ago, Joveice said:

Let's say I have 2 games with settings (this is just to try make a point)

 

so they both need a controller named SettingsController, I could just do GamenameSettingsController and have it under the folder Settings/Gamename/<here>

But are there any better ways of organizing them?

I'm not sure of your situation, but could you just use a single settings controller and add some sort of dynamic element to the games?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×