doufu9521
2018-02-02 01:53
浏览 92
已采纳

在PHP和Laravel中使用ReactJS [关闭]

Hey Guys so I just started learning ReactJS and I love it a lot, yet I have never seen anyone using it with PHP it seems like everyone uses Node instead, the question is can I even use PHP and Laravel with it? cheers.

图片转代码服务由CSDN问答提供 功能建议

Hey Guys所以我刚开始学习ReactJS并且我非常喜欢它, yet我从未见过有人使用过它 使用PHP似乎每个人都使用Node,问题是我甚至可以使用PHP和Laravel吗? 欢呼。

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • duanou9739 2018-02-02 01:56
    已采纳

    Yeah, absolutely! The backend does not matter since React is just a view layer (very controversial statement, but for the same of simplicity).

    As long as you expose the endpoints, consume it and then, in turn, provide React (or Redux) with the data, it doesn't matter which framework you use it with.

    The reason why people usually use Node.js is because of isomorphism: you write the backend and the frontend in the same language so you don't get confused.

    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • duanleixun2439 2018-02-02 02:42

    You can change out the Vue.js scaffolding in a laravel 5.5 project using

    php artisan preset react

    https://laravel.com/docs/5.5/frontend

    Would have simply commented this but not enough Rep yet! // yolo

    评论
    解决 无用
    打赏 举报