How to load module's view from its controller with a layout?
I've created a module at this location: fuel/modules/module-name/
The module-name directory contains these directories: views, models and controllers
I am trying to load a module view from a controller using this code:
$this->load->module_library(
'fuel_page',
array('location' => '/modules/module-name/views/myClass')
);
$this->fuel_page->render();
But I get this error:
Unable to load the requested class: myClass
I also tried this:
$this->load->view('/modules/module-name/views/myClass');
And got this error:
Unable to locate the file: modules/module-name/views/myClass.php
How can I load myClass.php file from controller? I need to render this view with the main layout (along with header and footer). How can I tell fuel to load this view using the main layout?
Comments
$vars = array(); $this->fuel->pages->render('mylocation', $vars, array('view_module' => 'my_module'));
fuel/application
fuel/codeigniter
fuel/modules/registeration
fuel/modules/registeration/controllers
fuel/modules/registeration/models
fuel/modules/registeration/views
fuel/modules/registeration/controllers/registeration.php
fuel/modules/registeration/models/registerations_model.php
fuel/modules/registeration/views/registeration.php
The content of "controllers/registeration.php": The content of "views/registeration.php" is: What am I doing wrong here?