NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
# view 通过加载器加载并返回一个模板 函数原型 ```php /** * view 返回一个模板 * @param $template * @return \League\Plates\Template\Template */ public function view($template) ``` 例子: ```php /** * html测试 */ public function http_html_test() { $template = $this->loader->view('server::error_404'); $this->http_output->end($template->render(['controller'=>'TestController\html_test','message'=>'页面不存在!'])); } ``` > server::error_404 是指Server/Views下的error_404.php文件 app::error_404 是指app/Views下的error_404.php文件 具体的请参考Plates模板引擎。 模板引擎参考[plates](http://platesphp.com/)