GFPHP \ Exception
Template:模板/home/wwwroot/www.0537web.cn/view/App/System/Index/xiaochengu.html 不存在. GFPHP\Exception thrown with message "Template:模板/home/wwwroot/www.0537web.cn/view/App/System/Index/xiaochengu.html 不存在." Stacktrace: #8 GFPHP\Exception in /home/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/Template.php:136 #7 GFPHP\Template:fetchTemplate in /home/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/Template.php:181 #6 GFPHP\Template:display in /home/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/Controller.php:77 #5 GFPHP\Controller:display in /home/wwwroot/www.0537web.cn/App/System/IndexController.php:109 #4 App\System\IndexController:xiaochenguAction in /home/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/Router.php:359 #3 call_user_func_array in /home/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/Router.php:359 #2 GFPHP\Router:runCallBack in /home/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/Router.php:205 #1 GFPHP\Router:run in /home/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/GFPHP.php:100 #0 GFPHP\GFPHP:run in /home/wwwroot/www.0537web.cn/website/index.php:8
Stack frames (9)
8
GFPHP
\
Exception
/
vendor
/
gfphp
/
framework
/
src
/
Template.php
136
7
GFPHP
\
Template
fetchTemplate
/
vendor
/
gfphp
/
framework
/
src
/
Template.php
181
6
GFPHP
\
Template
display
/
vendor
/
gfphp
/
framework
/
src
/
Controller.php
77
5
GFPHP
\
Controller
display
/
App
/
System
/
IndexController.php
109
4
App
\
System
\
IndexController
xiaochenguAction
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
359
3
call_user_func_array
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
359
2
GFPHP
\
Router
runCallBack
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
205
1
GFPHP
\
Router
run
/
vendor
/
gfphp
/
framework
/
src
/
GFPHP.php
100
0
GFPHP
\
GFPHP
run
/
website
/
index.php
8
/
home
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
Template.php
                    Debug::add('Template:更新缓存 ' . $path['template'] . $kVar . ' 缓存时间:' . $cache . '秒.');
 
                }
            } else {
 
                foreach ($this->var as $k => $v) {
                    $$k = $v;
                }
                ob_start();
                include $path['template_c'];
                $content = ob_get_contents();
                ob_end_clean();
                Debug::add('Template:使用模板 ' . $path['template'] . ' 未使用缓存.');
            }
 
            return $content;
        } else {
 
            header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
            throw new Exception('Template:模板' . $path['template'] . ' 不存在.');
        }
    }
 
    /**
     * 传入模板内容,返回模板编译执行后的内容
     *
     * @param $templateCon
     *
     * @return mixed
     */
    public function fetch($templateCon)
    {
        $template = '_tmp' . DIRECTORY_SEPARATOR . time() . random('6');
        /** @var string $template */
        $template_c = $this->get_path($template, 'view_c');
        $this->write($template_c, $this->template_parse($templateCon));
        foreach ($this->var as $k => $v) {
            $$k = $v;
        }
        ob_start();
/
home
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
Template.php
        return $content;
    }
 
    /**
     * 引用模板
     *
     * @param $template
     * @param bool $cacheTime
     * @param bool $cacheKey
     * @return mixed|String
     * @throws Exception
     */
    public function display($template, $cacheTime = FALSE, $cacheKey = FALSE)
    {
        if (Template::$layout) {
            $content = $this->fetchTemplate($template, $cacheTime, $cacheKey);
            $layout_content = $this->fetchTemplate(Template::$layout, $cacheTime, $cacheKey);
            return str_replace('[ _ _ _ CONTENT _ _ _ ]', $content, $layout_content);
        } else {
            return $this->fetchTemplate($template, $cacheTime, $cacheKey);
        }
    }
 
    /**
     * 获取路径
     *
     * @param        $templateName
     * @param string $type
     * @param bool $key KEY
     *
     * @return String
     */
    private function get_path($templateName, $type = 'template', $key = FALSE)
    {
        $templateName = str_replace('\\', '/', $templateName);
        switch ($type) {
            case 'template':
                $path = BASE_PATH . Config::template('view_dir') . DIRECTORY_SEPARATOR . GFPHP::$app_name . DIRECTORY_SEPARATOR . $templateName . Config::template('view_suffix');
                if (!$fileExits = file_exists($path)) {
                    $parseTemp = explode('/', $templateName);
/
home
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
Controller.php
    {
        if (func_num_args() == 1) {
            GFPHP::$Template->assign(func_get_arg(0));
        } elseif (func_num_args() == 2) {
            GFPHP::$Template->assign(func_get_arg(0), func_get_arg(1));
        }
    }
 
 
    /**
     * 编译当前行为模板
     * @param bool $cacheTime
     * @param bool $cacheKey
     * @return mixed|String
     */
    final function display($cacheTime = FALSE, $cacheKey = FALSE)
    {
        $this->Assign('_ACT', ['module_name' => MODULE_NAME, 'controller_name' => CONTROLLER_NAME, 'method_name' => METHOD_NAME]);
        /** @var string $template */
        return GFPHP::$Template->display('@' . METHOD_NAME, $cacheTime, $cacheKey);
    }
}
/
home
/
wwwroot
/
www.0537web.cn
/
App
/
System
/
IndexController.php
     * @return mixed|String
     */
    public function zhiboAction()
    {
        $this->assign('page_title', '直播系统 - ');
        $this->assignCategoryNews(13,3);
        $this->assignCategoryNews(14,3);
        $this->assignCategoryNews(12,3);
        $this->assign('info',productModel::model()->findByPk(2));
        return $this->display();
    }
 
    /**
     * @Route xiaochengu.html
     * @return mixed|String
     */
    public function xiaochenguAction()
    {
        $this->assign('page_title', '直播系统 - ');
        return $this->display();
    }
 
    /**
     * @Route about.html
     * @return mixed|String
     */
    public function aboutAction()
    {
        $this->assign('page_title', '关于亿佰 - ');
        $this->assign('list', articleModel::model()->where('category_id', 6)->query());
        return $this->display();
    }
 
    /**
     * @Route news.html news_(\d+).html
     * @param int $page
     * @return mixed|String
     */
    public function newsAction($page = 1)
    {
/
home
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
            define('MODULE_NAME', self::$module_name = ucfirst(strtolower($seg[0])));
            define('CONTROLLER_NAME', self::$controller_name = ucfirst(strtolower($seg[1])));
            define('METHOD_NAME', self::$action_name = strtolower($segments[1]));
            $controllerName = GFPHP::$app_name . '\\' . MODULE_NAME . '\\' . CONTROLLER_NAME . Config::router('controllerSuffix');
 
            /** @var Controller $controller */
            $controller = new $controllerName();
            $method = METHOD_NAME . Config::router('methodSuffix');
            if (!method_exists($controller, $method)) {
                if (Config::router('default_404')) {
                    return self::runCallBack(Config::router('default_404'), []);
                } else {
                    header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
                    throw new \Exception('method ' . $method . ' not find!');
                }
            }
            if (!is_array($params)) {
                return $controller->$method();
            } else {
                return call_user_func_array(array($controller, $method), $params);
            }
        }
    }
}
/
home
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
            define('MODULE_NAME', self::$module_name = ucfirst(strtolower($seg[0])));
            define('CONTROLLER_NAME', self::$controller_name = ucfirst(strtolower($seg[1])));
            define('METHOD_NAME', self::$action_name = strtolower($segments[1]));
            $controllerName = GFPHP::$app_name . '\\' . MODULE_NAME . '\\' . CONTROLLER_NAME . Config::router('controllerSuffix');
 
            /** @var Controller $controller */
            $controller = new $controllerName();
            $method = METHOD_NAME . Config::router('methodSuffix');
            if (!method_exists($controller, $method)) {
                if (Config::router('default_404')) {
                    return self::runCallBack(Config::router('default_404'), []);
                } else {
                    header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
                    throw new \Exception('method ' . $method . ' not find!');
                }
            }
            if (!is_array($params)) {
                return $controller->$method();
            } else {
                return call_user_func_array(array($controller, $method), $params);
            }
        }
    }
}
/
home
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
                foreach ($routers as $router) {
                    if (preg_match('#^' . $router . '?.*$#', $uri, $params)) {
                        $callback = self::$routes['ALL'][$router];
                        array_shift($params);
                        break;
                    }
                }
            }
        }
        if (!$callback) {
            $callback = function () {
                header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
                if (Config::router('default_404')) {
                    return self::runCallBack(Config::router('default_404'), []);
                } else {
                    throw new \Exception('没有匹配到路由!');
                }
            };
        }
        return self::runCallBack($callback, $params);
    }
 
    /**
     * 生成链接,路由反查返回
     * @param string $uri
     * @param array $get
     * @param string $method
     * @return string
     */
    public static function url($uri = '', $get = [], $method = 'GET')
    {
        $uri = $old_uri = parse_uri($uri);
        $uris = explode('/', $uri);
        $uris = array_filter($uris, function ($v) {
            if ($v === '') {
                return 0;
            } else
                return 1;
        });
        $count = count($uris);
/
home
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
GFPHP.php
        self::$Template = new Template();
        if (Config::config('develop_mod')) {
            $whoops = new \Whoops\Run;
            foreach (Config::debug('Whoops_handler') as $handler) {
                $whoops->pushHandler($handler);
            }
            $whoops->register();
        }
 
        self::$app_name = $app_name;
        Router::init();
    }
 
    /**
     * @return void
     * @throws \Exception
     */
    public static function run()
    {
        $response = Router::run();
        if (is_array($response)) {
            echo response_json($response);
        } else {
            echo $response;
        }
        Debug::stop();
    }
}
/
home
/
wwwroot
/
www.0537web.cn
/
website
/
index.php
<?php
include '../server.php';
$app = \GFPHP\Config::app();
if (!isset($app[$_SERVER['HTTP_HOST']])) {
    echo 'Bad Request!';
} else {
    \GFPHP\GFPHP::init($app[$_SERVER['HTTP_HOST']]);
    \GFPHP\GFPHP::run();
}
 

Environment & details:

empty
empty
empty
empty
empty
Key
Value
USER
www
HOME
/home/www
SCRIPT_NAME
/index.php
REQUEST_URI
/xiaochengu.html
QUERY_STRING
_router=xiaochengu.html
REQUEST_METHOD
GET
SERVER_PROTOCOL
HTTP/1.1
GATEWAY_INTERFACE
CGI/1.1
REDIRECT_QUERY_STRING
_router=xiaochengu.html
REDIRECT_URL
/xiaochengu.html
REMOTE_PORT
20018
SCRIPT_FILENAME
/home/wwwroot/www.0537web.cn/website/index.php
SERVER_ADMIN
webmaster@example.com
CONTEXT_DOCUMENT_ROOT
/home/wwwroot/www.0537web.cn/website
CONTEXT_PREFIX
REQUEST_SCHEME
http
DOCUMENT_ROOT
/home/wwwroot/www.0537web.cn/website
REMOTE_ADDR
154.222.130.82
SERVER_PORT
80
SERVER_ADDR
122.114.52.226
SERVER_NAME
www.0537web.cn
SERVER_SOFTWARE
Apache
SERVER_SIGNATURE
Apache Server at www.0537web.cn Port 80
LD_LIBRARY_PATH
/www/server/apache/lib
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_HOST
www.0537web.cn
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
proxy-nokeepalive
1
REDIRECT_STATUS
200
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1579277632.4327
REQUEST_TIME
1579277632
empty
0. Whoops\Handler\PrettyPageHandler