<?php namespace Admin; class Controller_Admin extends \Controller { /** * The basic welcome message * * @access public * @return Response */ public function action_index() { return \Response::forge(\ViewModel::forge('welcome/hello')); } }
Harro Verton wrote on Wednesday 13th of June 2012:If you want to return a viewmodel, you have to make the viewmodel class, in modules/admin/classes/view/welcome/hello.php if you use the name 'welcome/hello'. See http://docs.fuelphp.com/general/viewmodels.html which describes what a viewmodel is and how it works. If you want to return a view, don't forge a viewmodel, forge a view. Modules are like mini-apps, they are self-contained, and have their own classes and views folders, like your app. If you load a view from a module controller, it will look in the views folder of the module to load the view. If not found, it will check your app/views folder to see if there is a global view defined with the requested name.
It looks like you're new here. If you want to get involved, click one of these buttons!