admin/controllers/AdminRouter.php
protected function findAdminControllers()
    {
        //  Look in the admin module
        $this->loadAdminControllers(
            'admin',
            NAILS_PATH . 'module-admin/admin/controllers/',
            NAILS_APP_PATH . 'application/modules/admin/controllers/',
            ['adminRouter.php']
        );

        //  Look in all enabled modules
        foreach (Components::modules() as $module) {

            /**
             * Skip the admin module. We use the moduleName rather than the component name
             * so that we don't inadvertently load up the admin module (or any module identifying
             * itself as admin) and listing all the files contained therein; we only want
             * admin/controllers.
             */
            if ($module->moduleName == 'admin') {
                continue;
            }

            $this->loadAdminControllers(
                $module->moduleName,
                $module->path . 'admin/controllers/',
                NAILS_APP_PATH . 'application/modules/' . $module->moduleName . '/admin/controllers/'
            );
        }

        //  Finally, look for app admin controllers
        $this->loadAppAdminControllers();
    }
protected function findAdminControllers()
    {
        //  Look in the admin module
        $this->loadAdminControllers(
            'admin',
            NAILS_PATH . 'module-admin/admin/controllers/',
            NAILS_APP_PATH . 'application/modules/admin/controllers/',
            ['adminRouter.php']
        );

        //  Look in all enabled modules
        foreach (Components::modules() as $module) {

            /**
             * Skip the admin module. We use the moduleName rather than the component name
             * so that we don't inadvertently load up the admin module (or any module identifying
             * itself as admin) and listing all the files contained therein; we only want
             * admin/controllers.
             */
            if ($module->moduleName == 'admin') {
                continue;
            }

            $this->loadAdminControllers(
                $module->moduleName,
                $module->path . 'admin/controllers/',
                NAILS_APP_PATH . 'application/modules/' . $module->moduleName . '/admin/controllers/'
            );
        }

        //  Finally, look for app admin controllers
        $this->loadAppAdminControllers();
    }
Searches modules and the app for valid admin controllers which the active
user has permission to access.

@return void