Welcome Guest, Not a member yet? Register   Sign In
cms and hmvc problem
#1

[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">
               &lt;?php $this->load->view($subview); ?&gt;
   &copy; &lt;?php echo $meta_title; ?&gt;
  </div>
</div>
&lt;/body&gt;

&lt;?php $this->load->view('page_tail'); ?&gt;

and this is the templates controller
Code:
&lt;?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
#2

[eluser]Unknown[/eluser]
user controller
-------------------
class Users extends Mx_Controller {
public function login(){

$data['subview'] = 'login';
$this->load->module('templates');
$this->templates->_layout_modal($data);
}
}

template controller
------------------------
class Templates extends Mx_Controller {

function __construct() {
parent::__construct();

}

public function main($data){
$this->load->view('_layout_main', $data);
}

public function modal($data){

$this->load->view('_layout_modal', $data);
}
}




Theme © iAndrew 2016 - Forum software by © MyBB