-
Notifications
You must be signed in to change notification settings - Fork 1
side effects
Luke Morton edited this page Oct 22, 2011
·
1 revision
Although Beautiful View does not extend upon Kohana_View it
does steal it's namespace of View. My reasons behind this
are:
- I would be happy for Kohana to incorporate this into the core and therefore it is being developed as a replacement from the outset.
- Want all my current PHP templates to benefit from
improvements via
Template_PHP. -
Viewmakes more sense thanKostache.
You can read more into side effects by reading
Beautiful_View and Template_PHP. However here are a few
listed for clarity:
-
View::__construct()andView::factory()can take aTemplateobject as their first parameter as well as a string path. -
View::__construct()andView::factory()can take aViewModelobject as their first parameter as well as an array of data. -
View::__construct()andView::factory()will initialise aViewModelinstance if you pass an array as the second parameter to store the data in. -
View::__construct()andView::factory()will initialise aTemplate_PHPinstance if you pass an array as the second parameter. -
View::bind(),View::set()and their magic counterparts will attach data to theViewModel. Ideally you would set data directly to theViewModelinstance however for performance reasons. -
View::set_filename()now callsTemplate::set_filename(). -
View::render()now callsTemplate::render(). -
View::bind_global()is dropped completely because I do not care for these or your application if you use them. -
View::render()can now accept aTemplateobject as well as a string path.