mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-07 18:42:49 +08:00
增加response的事件机制;为login增加事件;发布新版本
This commit is contained in:
@@ -48,4 +48,36 @@ class View extends ThinkView
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析和获取模板内容 用于输出.
|
||||
* @param string $template 模板文件名或者内容
|
||||
* @param array $vars 模板变量
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function fetch(string $template = '', array $vars = []): string
|
||||
{
|
||||
return $this->config([
|
||||
'view_suffix' => 'html',
|
||||
])->getContent(function () use ($vars, $template) {
|
||||
$this->engine()->fetch($template, array_merge($this->data, $vars));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析和获取模板内容 用于输出.
|
||||
* @param string $template 模板文件名或者内容
|
||||
* @param array $vars 模板变量
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function fetchJS(string $template = '', array $vars = []): string
|
||||
{
|
||||
return $this->config([
|
||||
'view_suffix' => 'js',
|
||||
])->getContent(function () use ($vars, $template) {
|
||||
$this->engine()->fetch($template, array_merge($this->data, $vars));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user