user3119018
user3119018

Reputation: 199

Can't extend controller in fuel php

I'm tring to create a basecontroller which includes auth-check and extend it in other controllers.However,it displays not found error.

This is the basecontoller in fuel/app/classes/controller. Filename is admin.php.

class Controller_Admin extends Controller
{
    public function before(){

    }
}   

This is a sample controller in fuel/app/classes/controller.

class Controller_Sample extends Admin
{

}   

This codes cause this error.

ErrorException [ Fatal Error ]:
Class 'Admin' not found

How should I solve this?

Upvotes: 0

Views: 167

Answers (1)

Bhavya Shaktawat
Bhavya Shaktawat

Reputation: 2512

Instead of Admin use Controller_Admin

class Controller_Sample extends Controller_Admin
{

}  

Upvotes: 1

Related Questions