Bluz\Controller\Controller::getReflection PHP Method

getReflection() public method

Get Reflection
public getReflection ( ) : Reflection
return Reflection
    public function getReflection()
    {
        if (!$this->reflection) {
            $this->setReflection();
        }
        return $this->reflection;
    }

Usage Example

Example #1
0
namespace Application;

use Bluz\Controller\Controller;
use Bluz\Proxy\Layout;
/**
 * @privilege Info
 *
 * @return \closure
 */
return function () {
    /**
     * @var Controller $this
     */
    Layout::title('Routers Map');
    Layout::setTemplate('dashboard.phtml');
    Layout::breadCrumbs([Layout::ahref('Dashboard', ['dashboard', 'index']), Layout::ahref('System', ['system', 'index']), __('Routers Map')]);
    $routers = array();
    foreach (new \GlobIterator(PATH_APPLICATION . '/modules/*/controllers/*.php') as $file) {
        $module = pathinfo(dirname(dirname($file->getPathname())), PATHINFO_FILENAME);
        $controller = pathinfo($file->getPathname(), PATHINFO_FILENAME);
        $controllerInstance = new Controller($module, $controller);
        $reflection = $controllerInstance->getReflection();
        if ($route = $reflection->getRoute()) {
            if (!isset($routers[$module])) {
                $routers[$module] = array();
            }
            $routers[$module][$controller] = ['route' => $route, 'params' => $reflection->getParams()];
        }
    }
    $this->assign('routers', $routers);
};
All Usage Examples Of Bluz\Controller\Controller::getReflection