dongxing4643 2017-11-06 22:07
浏览 58

用于构建API的Yii框架

I have been working with Yii for some years, since version 1. I think is an awesome framework.

Today I need to build a website using Yii which includes building an API, administrator and frontend site.

In the past when I have worked in other similar projects. I shared model between them, each side (api, frontend and administrator) have their own controllers.

With Yii I am trying to find a way to organize it to take advantage of the full power of yii.

I was planning to use API only for mobile apps not for web frontend to be able to use Yii validation rules, etc and speed up the project.

Project owner wants to build a frontend which reads data through API too, that will bring duplicated validation rules etc.

If I follow project owner requirement it will be like managing 3 projects 1. Api + Backend 2. Frontend 3. Mobile

If I follow the other option, it will be like managing 2 projects: 1. API + Frontend + Backend 2. Mobile

Any advice?

  • 写回答

1条回答 默认 最新

  • dragon87836215 2017-11-07 01:51
    关注

    Use the advanced application template, make the common directory a git subtree. Then, you can use the subtree in any number of projects. There you are maintaining only one set of models for several applications. Works great for me.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大