dongshan4316 2016-01-30 11:17
浏览 39

您如何在YII中接近前端/后端?

I am using YII for the first time, and I just need some general opinions.

If I take, as an example, the User table, and I am going to have users register from the frontend, but I am also going to be managing users from the admin backend, how would you go about it?

Would you create one user controller and use that in both views, or would you create a UserController with its own views and AdminUserController with its own views?

  • 写回答

3条回答 默认 最新

  • doujiao3074 2016-01-30 12:06
    关注

    You may not have to necessarily recreate the module in all places. You can just place the module code in the common folder.

    1) If your module configuration is same for both frontend and backend - you can register your module in common/config/main.php. This should be available in both frontend and backend.

    2) If your module configuration is different for both frontend and backend - you can register your module separately in frontend/config/main.php and backend/config/main.php.

    Reference

    评论

报告相同问题?

悬赏问题

  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程