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?
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