-
Notifications
You must be signed in to change notification settings - Fork 0
Views.next
Olivier Laviale edited this page Jun 10, 2013
·
3 revisions
The biggest problem with the current implementation is that the View
class does too much: validate access; create the HTML element with class and id, manages assets; fetches data through providers; handles empty views with callbacks, events, registry values and even I18n messages; selects the engine used to render the data according to the template; renders the data.
The good things:
- Templates location are resolved by
TemplateResolver
instances. - Data in fetched by
Provider
instances (it would be nice if they were more independent thought).
The things that would be nice:
- Refactoring the
View
class to seperate concerns - Exceptions when the template cannot be resolved (a generic exception is currently used), when the provider returns nothing or the rendered view is empty.
- A simple way to call/render a view e.g.
(string) $core->views['articles/list']
and a nicer way to specify conditions (the current request is currently used).