duanqiao1926 2014-06-03 21:47
浏览 62

不同用户类型的应用程序设计

I'm trying to figure out the best way to build an application with multiple user types (i.e. Admin, Vendor and Customer).

I'm using Symfony2 to develop the application. I have two options in mind:

  1. Have one controller and check for the user role and render the corresponding view for that role. (One controller, Multiple views)
  2. Have one view and check for the user role to render the corresponding piece. (One controller, one view)

The difference between the above two methods, that is think the first one will have views to be cleaner, without too much logic in it. But will lead to too much logic inside the controller.

If there any better way to think this out ?

  • 写回答

3条回答 默认 最新

  • douyi1899 2014-06-03 21:51
    关注

    I developed a site with Symfony2 and user roles. I didn't change entire pages depending on the role, but there were significant chunks that would change based on role. I went with option 2 and used the logic within the views, and that seemed to work well for me. Cheers

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度