Ticket #436 (closed new feature: fixed)
new architecture for View classes
| Reported by: | lemon-head | Owned by: | lemon-head |
|---|---|---|---|
| Priority: | major | Milestone: | Rox Framework |
| Component: | FrameWork | Keywords: | |
| Cc: |
Description
We can make it a lot easier to code view classes, by using inheritance and polymorphism.
Have a look at the new application 'about' - it uses the new mechanism.
Change History
comment:1 Changed 4 years ago by lemon-head
- Owner set to lemon-head
- Status changed from new to assigned
comment:2 Changed 4 years ago by lemon-head
- follow_up changed from none to review code
[4225] - a new 'about' application, to prove that it works.
comment:3 Changed 4 years ago by lemon-head
[4240] - first steps towards a template switcher.
A new way to include template files, to constrain the power of template files.
A later step will be to use an exchangeable $template_factory, that will allow template switching.
Advantages:
- Template files included with the new mechanism can't use methods or private fields of the $view object. All dependencies have to be injected explicitly into the template, using the $args argument.
- Some dependencies (currently only $words) are injected by RoxPageView, so the application writer doesn't need to care about it.
- In the future we can use an exchangeable $template_factory object. Instead of the usual templates, it could return
- mock templates for testing (which don't include a file, but only echo the template name.
- templates in a different directory - this would have the effect of skinning.
comment:4 Changed 4 years ago by lemon-head
see RoxPageView
comment:5 Changed 4 years ago by lemon-head
In the meantime everything needed for RoxPageView is in /tools/ folder, and depends on other things in /roxlauncher/ (especially, to parse the "autoload.ini").



[4224] - all View classes can now inherit from RoxPageView, and redefine the protected methods.