|
|||
|
This is one thing I have not yet fully understood as what is the best practice to seperate two interfaces (public and admin) of the same web app. I have couple of ideas:
Have 2 modules - public and admin: Code:
Application
+ Admin
+ controllers
+ IndexController, ArticlesController, ForumController, ...
+ views
+ models
+ Public
...
My other idea is to treat each type of the content page as a module (articles, forum, gallery) and have AdminController and PublicController files Code:
Application
+ Articles
+ controllers
+ PublicController, AdminController
+ Forum
...
My 3rd idea is splitting both interfaces completely apart and use sort of common classes... |
|
|||
|
You can set include_path with directory to the public models as default and create abstract controller for all admin controllers with additional path to admin models if needed.
PHP Code:
|
|
|||
|
This doesn't solve my dilemma. Especially if my project is neither smalll nor exactly simple. It also introduces an extra level of indirection.
I am looking for a clean solution to seperate two interfaces and yet couple them together in a logical way. I don't personally like the idea of hiding bootstrap logic into derived controller base classes - it will confuse someone else working with my code. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|