Can I call a Model from a View?

后端 未结 4 1848
再見小時候
再見小時候 2020-11-27 21:13

Rather than use a full-blown PHP MVC, I\'m designing one that will best-fit my uses. I have the basic framework done, and have coded the models and controllers I\'ll need to

4条回答
  •  伪装坚强ぢ
    2020-11-27 21:45

    While I only know enough about MVC to get myself in trouble, I've always lived by the fact that unless your view is STRICTLY user interface, then it shouldn't be there.

    Also, I've also ran with the idea of thin controllers, fat models.

    Going off of these, I'd suggest adding a method to your authentication system model that returns the appropriate view to render and passes that to the view.

提交回复
热议问题