public function loadController($template)
    {
        $template = basename($template) . '.php';

        do_action('Municipio/blade/before_load_controller');

        if (basename($template) == '404.php') {
            $template = 'e404.php';
        }

        switch ($template) {
            case 'author.php':
                if (!defined('MUNICIPIO_BLOCK_AUTHOR_PAGES') || MUNICIPIO_BLOCK_AUTHOR_PAGES) {
                    $template = 'archive.php';
                }
                break;
        }

        $controller = \Municipio\Helper\Controller::locateController($template);

        if (!$controller) {
            $controller = \Municipio\Helper\Controller::locateController('BaseController');
        }

        $controller = apply_filters('Municipio/blade/controller', $controller);

        require_once $controller;
        $namespace = \Municipio\Helper\Controller::getNamespace($controller);
        $class = '\\' . $namespace . '\\' . basename($controller, '.php');

        do_action('Municipio/blade/after_load_controller');

        return new $class();
    }