src/App.php
public function loadTemplate($name)
    {
        $template = new Template();
        $template->app = $this;

        if (in_array($name[0], ['.', '/', '\\']) || strpos($name, ':\\') !== false) {
            return $template->load($name);
        } else {
            $dir = is_array($this->template_dir) ? $this->template_dir : [$this->template_dir];
            foreach ($dir as $td) {
                if ($t = $template->tryLoad($td.'/'.$name)) {
                    return $t;
                }
            }
        }

        throw new Exception(['Can not find template file', 'name'=>$name, 'template_dir'=>$this->template_dir]);
    }
public function loadTemplate($name)
    {
        $template = new Template();
        $template->app = $this;

        if (in_array($name[0], ['.', '/', '\\']) || strpos($name, ':\\') !== false) {
            return $template->load($name);
        } else {
            $dir = is_array($this->template_dir) ? $this->template_dir : [$this->template_dir];
            foreach ($dir as $td) {
                if ($t = $template->tryLoad($td.'/'.$name)) {
                    return $t;
                }
            }
        }

        throw new Exception(['Can not find template file', 'name'=>$name, 'template_dir'=>$this->template_dir]);
    }
public function loadTemplate ( $ name ) { $ template = new Template ( ) ; $ template -> app = $ this ; if ( in_array ( $ name [ 0 ] , [ '.' , '/' , '\\' ] ) || strpos ( $ name , ':\\' ) !== false ) { return $ template -> load ( $ name ) ; } else { $ dir = is_array ( $ this -> template_dir ) ? $ this -> template_dir : [ $ this -> template_dir ] ; foreach ( $ dir as $ td ) { if ( $ t = $ template -> tryLoad ( $ td . '/' . $ name ) ) { return $ t ; } } } throw new Exception ( [ 'Can not find template file' , 'name' => $ name , 'template_dir' => $ this -> template_dir ] ) ; }
Load template by template file name.

@param string $name

@throws Exception

@return Template
Load template by template file name .