model view controller - MVC for a CMS? What about themes? -


I understand what MVC and CMS are. I understand how MVC patterns and CMS should work. But I have problems with themes and patterns.

Example:

When CMS is installed on the Surveyor, I want to change my homepage. I want to display some additional data, I change my homepage template and add function call to draw data from DB. My new data will be displayed on my homepage :)

But when I do this, I broke the MVC pattern because in this situation, what data should be read from DB on my homepage?

So ... is it MVC for a CMS? Or maybe it should not be a clear MVC pattern to work with such situations? Maybe I should forget about the pattern? I'm confused ...

PS WordPress is not built on this MVC pattern, I think?

Design patterns such as MVC mean that separating your display code from business logic and so on. It makes it easy to change any part without affecting any part (eg, about changing any commercial logic by mistake).

Do you think the function you are adding is simple visual arguments? It can be best to enter this function in the assistant and the model can make support calls for data. Then, in your opinion, call the assistant.

In the pseudocode: Auxiliary

  get_whatever_data () {// Get real data from Model Return SomeModel .get_the_data_thats_needed_here ()}  

View

  & lt; Div id = "some-id" & gt; By & lt;? Print get_whatever_data ()? & Gt; & Lt; / Div & gt;  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -