Hi am watching this video https://www.youtube.com/watch?v=DS0GeknUkds for setting up my hmvc templates. i am already trying to call other modules but i got the error
Severity: Notice
Message: Undefined property: CI::$Templates
Filename: MX/Controller.php
Line Number: 59
i have this templates folder with a controller file Templates.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Templates extends MY_Controller{
public function views($data = NULL){
$this->load->view('templates/one_view');
}
}
?>
this perfectly works if i directly called it. but the problem is on my login module.(http://localhost/ci_hmvc/index.php/login/index) i get the error,
Message: Undefined property: CI::$Templates
Filename: MX/Controller.php
Line Number: 59
and
Severity: Error
Message: Call to a member function views() on null
Filename: controllers/Login.php
Line Number: 10
my controller is,
Login.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Login extends MY_Controller{
public function index(){
$data['content_view'] = 'login/login_view';
$this->Templates->views($data);
}
}
?>
how can i resolve this? is there is a problem with the hmvc setting ? or what?
p.s
i extended it to MY_Controllers because i have this file,
MY_Controller.php on my core folder..
<?php
class MY_Controller extends MX_Controller {
function __contsruct()
{
parent::__construct();
$this->load->module('Templates');
}
}
?>
thanks
In My_Controller change
to