[eluser]Shiva666[/eluser]
I'm busy with doing a tutorial on creating a cms and I'm trying to put that tutorial in an hmvc structure and I have ran into a problem.
I have these errors
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined variable: subview
Filename: views/_layout_modal.php
Line Number: 8
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined variable: _ci_file
Filename: MX/Loader.php
Line Number: 309
Quote:An Error Was Encountered
Unable to load the requested file:
with the first error it is being defined in the user controller of the users module.
Here is the users controller
Code:
<?php
class Users extends Admin_Controller {
function __construct() {
parent::__construct();
}
public function login(){
$this->data['subview'] = 'login';
$this->load->module('templates');
$this->templates->_layout_modal();
}
}
This is the _layout_modal view
Code:
<?php $this->load->view('page_head'); ?>
<body #555">
<div class="modal-dialog" >
<div class="modal-content">
<?php $this->load->view($subview); ?>
© <?php echo $meta_title; ?>
</div>
</div>
</body>
<?php $this->load->view('page_tail'); ?>
and this is the templates controller
Code:
<?php
class Templates extends Admin_Controller {
function __construct() {
parent::__construct();
}
public function main(){
$this->load->view('_layout_main', $this->data);
}
public function modal(){
$this->load->view('_layout_modal', $this->data);
}
}
Let me know if there is anything else you need