在MVC中,哪个层确定将哪些(动态)数据加载到模型中?

In MVC, which layer determines which (dynamic) data are loaded into a model?

In my web application, the ArticleView displays an "author card," or metadata about the user who wrote the article. In my current setup, the UserModel decides what data to pull from the DB for the author card in a function called getCardData:

class UserModel {
    public function getCardData() {
       $cardFields = ['firstName', 'lastName', 'avatarChoice', 'email', 'facebookId'];
       $cardData = $this->loadDataFromPersistenceLayer($cardFields);
       return $cardData;
    }
}

I’m not sure if this is incorrect, perhaps this function instead should go in the view? or the controller?

Fuzzier to me is something like a dynamic category archive page, which would contain a collection of articles. Trying to work it out:

  • the CategoryController gets an array of article ids from the CategoryModel
  • CategoryController creates some ArticleModels/ArticleViews
  • CategoryController tells each what data to load
  • CategoryController renders each ArticleView
    • $data = $articleView->renderCategoryPageTemplate();
  • CategoryController passes that rendered data to CategoryView which incorporates it into its output.

No matter how I think about it, it seems wrong to me.

Notes, if it matters:

  • I have a Redis layer that I prefer to hit instead of the DB when possible for metadata
  • There are user- and article-meta tables to support dynamic properties, so I’m not dealing with fixed columns so to speak

Based on my knowledge, deciding what goes where or when or ... is related to your business logic and as much as it's kept independent of your underlying layer or system you can put it anywhere.
Keeping independent from underlying system(or layer) means even if you some day decided to migrate your mvc framework to something else, your business logic can be kept intact