帮助命名我的管理员相关控制器
我无法为我的管理相关控制器想出一个好听的名字。
我有一个用于该站点的 UserController(非管理相关操作)。现在我创建了一个具有以下 url 格式的 ADMIN 部分:
www.example.com/admin/{controller}/{action}/{id}
我的控制器文件夹的布局如下:
/controllers/ /控制器/管理/管理控制器 /controllers/usercontroller
我需要创建一个控制器来编辑/删除/列出用户以对其执行管理相关操作。
我将把这个控制器放在我的 /controllers/admin/ 文件夹中,只是为了让它们分开。
我应该给这个控制器命名什么?
我不想做 AdminUserController
因为它看起来很傻,有什么帮助吗?
I can't come up with a nice name for my admin related controllers.
I have a UserController that is used for the site (non-admin related actions). Now I created an ADMIN section that has the following url format:
www.example.com/admin/{controller}/{action}/{id}
My controller folder is layed out like:
/controllers/
/controllers/admin/admincontroller
/controllers/usercontroller
I need to make a controller for editing/deleting/listing users to perform admin related actions on them.
I will place this controller in my /controllers/admin/ folder just to keep them seperate.
What should I name this controller?
I don't want to do AdminUserController
As it just looks silly, any help!?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以将它们放在 YourProject.Controllers.Admin 命名空间中。
或者,如果只是为了“url”目的,您可以为这些控制器创建特定的路由,即
You could put them in an YourProject.Controllers.Admin namespace.
Alternatively if it is just for "url" purposes, you could create specific routes for these controllers, i.e.
管理操作控制器?
您是否有理由不希望它们出现在您的 AdminController 中?所有这些行动似乎都属于这一类。
编辑:那么 EditController 呢?
AdminActionsController?
Is there a reason you don't want them inside your AdminController? All of these actions seem to fall under this category.
EDIT: What about EditController then?
UserManagementController 或 ManageUserController 或其他类似的东西。
www.example.com/admin/UserManagement/{action}/{id}
www.example.com/admin/ManageUser/{action}/{id}
UserManagementController or perhaps ManageUserController or something else along those lines.
www.example.com/admin/UserManagement/{action}/{id}
www.example.com/admin/ManageUser/{action}/{id}