Welcome Guest, Not a member yet? Register   Sign In
HTML in Model
#1

Hi Everyone

New to MVC Model programming, so basic question sorry : 

Normally, if I understand correctly, this is where everything resides : 

Controller : Loads the different logic and views
Model : contains the logic (ie loading data from MySQl, different functions for calculating, etcetera)
View : Contains the HTML markup and little PHP to ech values received from the Model

This is all pretty straightforward until you run into AJAX to recalculate certain parts of your page.
Let's say I have a table with users, when I add a user I want to reflect that in the table without refreshing the whole page.
So normally you would run an AJAX call to some PHP script that then renders the table again.

Under the MVC model, my AJAX call is done to model/function , but that effectively means that part of my HTML markup
will have to be moved to the Model, because the return value to the AJAX call has to contain all the HTML in order to put it in the response DIV . And this is my question : is it normal and OK to move parts of HTML to the model

Thanks, hopefully it's a bit clear what I'm trying to explain.
Reply


Messages In This Thread
HTML in Model - by AngelTrader - 09-25-2019, 11:13 PM
RE: HTML in Model - by ciadmin - 09-25-2019, 11:26 PM
RE: HTML in Model - by AngelTrader - 09-25-2019, 11:35 PM
RE: HTML in Model - by dave friend - 09-26-2019, 06:11 AM
RE: HTML in Model - by albertleao - 09-26-2019, 10:14 AM
RE: HTML in Model - by ciadmin - 09-26-2019, 10:30 AM
RE: HTML in Model - by AngelTrader - 09-26-2019, 10:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB