Welcome Guest, Not a member yet? Register   Sign In
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

(This post was last modified: 08-27-2019, 08:24 AM by InsiteFX.)

./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




Theme © iAndrew 2016 - Forum software by © MyBB