Benim kod göz önünde bulundurun:
<?php
class MY_Controller extends Controller {
public function __construct()
{
parent::Controller();
}
function _displayPage($page, $data = array()) {
$this->load->view('structure/header', $data);
$this->load->view($page, $data);
$this->load->view('structure/footer', $data);
}
}
?>
page.php
<?php
class Page extends MY_Controller {
function __construct() {
parent::__construct();
}
function index() {
$data['content'] = array('title'=>'hello world');
$this->_displayPage('home', $data);
}
}
?>
Benim tarayıcınızın benim sayfa yükleniyor sonra, bu hatayı alıyorum:
A PHP Error was encountered Severity: Notice Message: Undefined property: Page::$view Filename: libraries/MY_Controller.php Line Number: 11
Does anyone know what I'm doing wrong? Thanks