codeigniter controller inheritance class not found – on different files

Posted: April 5, 2013 in php
Tags: , , , ,

If you want to extend a CI_Controller you need to add an include statement on the Child class php file.

for example, I did a CI_Controller named Loggable which includes login/logout/register functionallity and I want another Controller named webClient to inherit.

So it looks like:

controllers/loggable.php:

class Loggable extends CI_Controller {

controllers/webclient.php

include(‘loggable.php’);

class Webclient extends Loggable {

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s