php - Where to put a "common" controller (for admin/front catalogs) in MVC pattern -


in symfony 3 created 2 subfolders in "controller" folder: "admin" , "front", first 1 responsible administrative tasks, , second 1 for, well, displaying frontpage.

i have "usercontroller", sits in "front" folder, because there methods "register" or "login" cannot in "admin" folder (because 1 must logged in access url)

now want create possibility edit user details in admin panel. method called "edit" example.

what's best way it? architectural pattern point of view?

  1. create usercontroller in "admin" folder.

  2. move existing usercontroller new folder, called e.g. "common", , add "edit" method there.

from 2 options have specified go 1st option. it's idea seperate controllers functionality. (eg. modifying tasks, etc).

but understand have 3 roles together. (admin, member , anonymous). might think grouping categories followed:

admin, public, member

keeping common member controllers , tasks in there, login , register in public , full admin task in folder. admins example can edit data members well. member can edit his/her own data.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -