Home >Backend Development >PHP Tutorial >javascript - How to build a website with webpack+react+PHP?

javascript - How to build a website with webpack+react+PHP?

WBOY
WBOYOriginal
2016-08-20 09:04:051255browse

Usually when PHP builds the backend, the data interface is embedded in the web page, while webpack+react usually generates an html and a bundle, so how do the two come together?

Reply content:

Usually when PHP builds the backend, the data interface is embedded in the web page, while webpack+react usually generates an html and a bundle, so how do the two come together?

Webpack generates a .js file after packaging. Use <script></script> to directly introduce this file into the HTML page. PHP is only used to send HTML.

PHP only needs to provide JSON data, and everything else is written in ReactJS

Except that PHP returns json data, everything else is the same as above

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn