How do I extend the code igniter controller class?
Posted
by ChronoFish
on Stack Overflow
See other posts from Stack Overflow
or by ChronoFish
Published on 2009-10-26T17:57:26Z
Indexed on
2010/05/07
10:38 UTC
Read the original article
Hit count: 165
php
|codeigniter
Hello,
In my CI system\libraries directory I have a new class named DD_Controller.php. This file looks like this:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class DD_Controller extends Controller
{
protected $ddauthentication;
function __construct()
{
parent::Controller();
$this->ddauthentication = "Authenticated";
}
}
?>
My application controller is defined like this:
class Inquiry extends DD_Controller
{...}
The Inquiry class works fine when I extend Controller, but I get a
Fatal error: Class 'DD_Controller' not found in C:\development\localhost\applications\inquiry\controllers\inquiry.php on line 4
When I extend DD_Controller. In the config file I have the prefix defined as such:
$config['subclass_prefix'] = 'DD_';
Any idea of what I'm missing?
TIA
© Stack Overflow or respective owner