Im trying to inherit a constant var which are in another file/class. But I tried almost everything and I can't do it for some reason, can anyone tell me what is wrong or just are happening in my code please?
this is my main class that i called BasePage.
class BasePage extends CI_Controller {
const $TITLE = "My Own DB";
}
and this is the other class/file which is trying to inherit to other class by giving the constant var TITLE into an array.
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require 'BasePage.php';
class Home extends BasePage {
public function index()
{
$data = array('title' => $TITLE);
$this->load->helper('url');
$this->load->view('page_login', $data);
}
}