I have a JS script that sends a request to the server by AJAX, as I understood the JS script should be the same php script that accepted the query, the question is whether the way it makes the answer so that the answer came from another script, say the request received ACT_INPUT. PHP but will answer must act_output.php, I bet to implement Patern MVS and there "controller" accepts a request (including AJAX) but the answer should return "View", please tell me how to implement it

Not mvs, but MVC. And I will surprise you, but the answer will return the controller. That's just the answer can be different: maybe just JSON, and maybe HTML. Where he will take the data -his business. He can join the "View" pattern and turn it out as an answer.

Алексей Шиманский2021-09-04 05:49:34

And in order for a thousand such questions, it does not occur -to start reading books on PHP. There are certainly books that are already from zero to OOP + MVC, everyone disassembled in detail and more than once.

Алексей Шиманский2021-09-04 05:50:42

Books and educational resources by PHP

Алексей Шиманский2021-09-04 05:51:33