2
I have a CRUD in PHP developed with the MVC standard, all interaction with the database is performed with PDO, my challenge is, pass all data requests asynchronously using Ajax and Json. I have only theoretical knowledge about asynchronous requests and would like to know how best to make this change? there is some framework that can be performed?
Thank you!
Hello Phelipe, my main doubt is how to pass on this information following the MVC standard
– Lucas Carvalho
Using AJAX you will already be preserving the MVC structure. Everything you have printed in your PHP code will be in the result variable. So, assuming you want to print a table for example, you can mount a json in your back-end, retrieve that information by the result variable in your javascript, and then do what you want with it. Javascript offers a complete range of tools to handle the DOM, so you can manipulate your page by completely separating front-end and back-end
– Phelipe
I think I understand the idea of the process, I will try to implement in the code and, if necessary, I return the question. Thank you very much for helping Phelipe!
– Lucas Carvalho