[eluser]pickupman[/eluser]
Codeigniter does not include any controllers, other than the simple "Hello world" welcome.php controller. An admin controller is probably used on any application, but how many would every been the same. My guess is zero.
You can make an admin controller as easy as:
Code:
class Admin extends CI_Controlelr{
public function __construct()
{
parent::__construct();
$this->load->library('auth_library');
if ( ! $this->auth_library->is_admin() )
{
redirect('login');
}
}
}
//Routes
$route['admin/(:any)/(:any)'] = '$1_admin/$2'; // admin/blog/index => blog_admin/index
$route['admin/(:any)'] = 'admin/$1'; // admin/index => admin/index
$route['admin'] = 'admin/index'; // admin => admin/index
I like to create an admin controller for each module/controller, so you don't end up with some large Admin controller. Again, this allows you to create a frontend & backend controllers you can move to different projects. I use the admin controller for only the "dashboard" part of the backend.