• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Folder in Controllers

#1
Hi

I created an Admin folder in Controllers. And inside the Admin folder the file Home.php as BaseController class.


Not found this file and error 404. Should not find automatic?
Reply

#2
./app/Controllers/Admin

Home Controller:

PHP Code:
<?php namespace App\Controllers\Admin;

use 
App\Controllers\BaseController;

/**
 * Class Home
 *
 * @package App\Controllers\Admin
 */
class Home extends BaseController
{
 
   /**
     * index ()
     * -------------------------------------------------------------------
     *
     */
    
public function index()
    {
 
      echo 'Admin Home Controller!';
    }

 
   //--------------------------------------------------------------------



To access:

http://yoursite/Admin/home

Remember all folders are now namespaces.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
Missed this:
use App\Controllers\BaseController;

In the root controllers is not required.

Thanks Smile
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.