About Laravel front-end and back-end collaboration
淡淡烟草味
淡淡烟草味 2017-05-16 16:53:55
0
1
272

The subject managed a micro team (8-10 people) when participating in the Laravel5.1 project. The responsibilities of the front-end and back-end personnel were separated, but the following problems were encountered:

  1. Laravel front-end uses blade template, which is PHP. When the front-end progress is greater than the back-end progress, it is not easy to debug (the back-end has no relevant routing and logic);

  2. Controller->View transmits data. Does the specific data display responsibility belong to the front end or the back end? What writing standards should be followed for the front and back ends?

  3. After using blade template, the readability and maintainability of html are slightly reduced. How to solve it?

Has anyone encountered the above problem? How was it resolved? Thanks!

淡淡烟草味
淡淡烟草味

reply all(1)
漂亮男人

我认为的前后端分离是这样的

  • 后端负责产出 API

  • 前端使用 JS 实现 view

如果像题主说的那样,比较像是前端人员负责 blade 切版

给题主参考一下我目前 Laravel 5.1 项目的开发状况

  1. 同一个 feature 由同一人负责开发,后端及 blade 模版

  2. 后端准备好 data 给前端,写作规范目前就是
    。变数命名统一
    。丢已处理过得资料至 view (view 只负责显示,没有过多的处理资料罗辑)

  3. 我觉得 blade 只是 php template 的扩充而已,且不支援变数賦值(这挺讨厌的),可读性要好的话可以试试其它的 template,像是 jade 系列的 tale-jade,但似乎还蛮新的

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!