fuel / core

Fuel PHP Framework - The core of the Fuel v1 framework
http://fuelphp.com
813 stars 345 forks source link

Use ViewModel with themes #1095

Closed timurbakarov closed 12 years ago

timurbakarov commented 12 years ago

I wanted to use ViewModel with themes but it seems not impossible right now without tweaking the core. It would be good it there was such an option.

WanWizard commented 12 years ago

Using Viewmodels is not a problem All theme class methods accept strings (which will be converted to a View object by the Theme class, or anything else that can be cast to string.

Note that as your theme views are not in the standard location, the Viewmodel won't be able to autoload the view. Instead, you will have to load it manually in the Viewmodel. See http://docs.fuelphp.com/general/viewmodels.html#/changing_view