View Objects
$page->add('H1')
->set('View Demo');
$page->add('Frame')
->setTitle('Sample Frame');
->add('LoremIpsum');
Views are Objects capable of producing HTML output.
There are many standard view classes.
View is a fundamental building blog representing the area on the HTML page. View classes inherit from either AbstractView or "View" class.
Any view has a template property containing a SMlite instance. Normally the render() method will append content into owner's template. Property "spot" determines where output appears exactly.
Table of Contents:
Goals and Features of View
- Represent self-sufficient object which can be re-used on different application pages
- Separate UI logic (view) from template. Allow to use same logic with template of choice
- Move heavy processing logic into render() while keeping init() lightweight
- Permit Controllers and sub-objects also add output into view's template
- Support chaining which is used to define view's configuration
- Implement js() method for easy event binding
- Populate some tangs automatically
Other Resources
Other Resources, Blog posts:
