\Fuel::add_module('module_name', true);method to load desired module. Second argument in that method allowed me to load views that belongs to loaded module. Problem is, now there's no second argument option. Does it, mean that views being loaded automatically?
<?php namespace Bar; class Controller_Bar { public function init() { \Event::register('test', 'Bar\Controller_Bar::hello_world'); } public function hello_world() { return \View::factory('hello_world')->render(); } }
return \View::factory(strtolower(__NAMESPACE__).'::hello_world')->render();
$view = View::factory("module::folder/view");
Request::active()->add_path(APPPATH.'modules/module');
<?php namespace Foo; class Controller_Foo { public function action_index() { \Fuel::add_module('bar'); echo \Bar\Controller_Bar::hello_world(); } }
<?php namespace Bar; class Controller_Bar { public function hello_world() { return \View::factory('hello_world')->render(); } }
$widget = Request::factory('bar/controller/method', false);in which case you need an action_method() in your controller. Or add the 'bar' module path to the current request:
Request::active()->add_path(APPPATH.'modules'.DS.'bar');
class Controller_Bar {; public function hello_world() { return \View::factory('bar::hello_world')->render(); } }
It looks like you're new here. If you want to get involved, click one of these buttons!