public function fetch($template, $data = [], $config = [])
{
if ('' == pathinfo($template, PATHINFO_EXTENSION)) {
// 获取模板文件名
$template = $this->parseTemplate($template);
}
// 模板不存在 抛出异常
if (!is_file($template)) {
throw new TemplateNotFoundException('template not exists:' . $template, $template);
}
// 记录视图信息
$this->app
->log('[ VIEW ] ' . $template . ' [ ' . var_export(array_keys($data), true) . ' ]');
$this->template->fetch($template, $data, $config);
}
PHPSESSID | 7us44pcg9ga6f39issjn8p5p30 |
USER | www |
HOME | /home/www |
HTTP_COOKIE | PHPSESSID=7us44pcg9ga6f39issjn8p5p30 |
HTTP_ACCEPT_ENCODING | gzip |
HTTP_ACCEPT | */* |
HTTP_HOST | www.zc-hightech.com |
HTTP_USER_AGENT | Mozilla/5.0 (Linux; Android 7.0;) AppleWebKit/537.36 (KHTML, like Gecko) Mobile Safari/537.36 (compatible; PetalBot;+https://webmaster.petalsearch.com/site/petalbot) |
PATH_INFO | |
REDIRECT_STATUS | 200 |
SERVER_NAME | www.zc-hightech.com |
SERVER_PORT | 443 |
SERVER_ADDR | 172.18.111.6 |
REMOTE_PORT | 45596 |
REMOTE_ADDR | 50.2.184.202 |
SERVER_SOFTWARE | nginx/1.18.0 |
GATEWAY_INTERFACE | CGI/1.1 |
HTTPS | on |
REQUEST_SCHEME | https |
SERVER_PROTOCOL | HTTP/1.1 |
DOCUMENT_ROOT | /www/wwwroot/www.zc-hightech.com/public |
DOCUMENT_URI | /index.php |
REQUEST_URI | /news/15/40 |
SCRIPT_NAME | /index.php |
CONTENT_LENGTH | |
CONTENT_TYPE | |
REQUEST_METHOD | GET |
QUERY_STRING | s=/news/15/40 |
SCRIPT_FILENAME | /www/wwwroot/www.zc-hightech.com/public/index.php |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1717535691.9505 |
REQUEST_TIME | 1717535691 |
TEMP_HTML_PATH | ./html/ |
PINYIN_DEFAULT | 4096 |
PINYIN_TONE | 2 |
PINYIN_NO_TONE | 4 |
PINYIN_ASCII_TONE | 8 |
PINYIN_NAME | 16 |
PINYIN_KEEP_NUMBER | 32 |
PINYIN_KEEP_ENGLISH | 64 |
PINYIN_UMLAUT_V | 128 |
PINYIN_KEEP_PUNCTUATION | 256 |