Function render_display_response
Source pub fn render_display_response(
view: &View,
content: &str,
vars: Option<HashMap<String, Value>>,
) -> Result<Response<Body>, ViewError>
Expand description
渲染字符串内容为 HTML Response(兜底场景,自由函数版本)
对齐 PHP $this->display($content) + Response::create($content, 'html')。
view:视图实例
content:模板字符串内容
vars:模板变量(可选)
Ok(Response):HTTP 200,Content-Type: text/html; charset=utf-8
Err(ViewError):渲染失败