I'm using the Nette framework, which uses the MVC paradigm. Thing is, my site is supposed to be mostly static, just having a register/login form and a mini-forum/guestbook, other pages will be static. How do you properly employ the use of this paradigm on such sites? For one, I am not sure how many controllers/views I want for this or if there are supposed to be any models for the static parts. I also am not sure whether the static data should be hardcoded or if it should be grabbed from the database. Could anyone enlighten me about this? I have read many articles about MVC and understand how it should work in theory, but I can't apply it myself...
1条回答 默认 最新
- drztpx8735 2013-05-29 13:19关注
A static page is just the view which will sent to the client by the controller, no model involved as there is no business logic. So what you will have is effectively VC, with the controller serving the view.
If you make your static pages from a template, then there won't be much work to do if you decide they need some dynamic content later.
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报