Rendering HTML with AJAX call using PHP and MVC concept

0

Good evening.

I usually use the MVC (Model-View-Controller) standard, regardless of programming language.

In PHP, the directory structure looks like this:

- assets
    - css
    - js
    - img
    - font
- model
- controller
- view
- session
- database
  index.php

The question I have is how much in an AJAX call passing data to a PHP file and returning only results from the database using the parameters passed by the AJAX call as input.

Following the MVC model we can build the HTML directly in the controller or it would be more certain to return only the values and make the HTML be rendered in the page using JavaScript, however leaving to the client side to render the HTML in the page what it can leave the slow client side.

If you know not only these two solutions, but others to receive HTML and rendering using the concept of MVC in a particular page also accepted, what we want is to learn more about this.

    
asked by anonymous 18.07.2015 / 02:55

0 answers