I agree that injecting a templating library/component is definitely the best option. Though, I expect the view would still need to decide for itself which template to render, because the template may need to vary depending on the user input (a result from the controller). For instance, if user input doesn't validate, then the view may need to render a form with errors. Or if the input does validate, then the view may need to render a success message or perhaps a redirect response. Though, I definitely don't think the model should be involved with the templates in any way, shape or form. The model is supposed to be about domain logic, and templates are about presentation.



Reply With Quote




Bookmarks