library/Template.php
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();
    }
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();
    }
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 ( ) ; }
Loads controller for view template
@param  string $template Path to template
@return bool             True if controller loaded, else false
Loads controller for view template