./app/view/目錄中新建`success.html`和`error.html`兩個模板文件,分別對應success和error兩個函數默認的模板。
~~~
if($result){
$this->success('新增成功', 'User/list');
} else {
$this->error('新增失敗');
}
~~~
**注意:**
新建模板后,需要在config.php修改下模板文件路徑
//默認錯誤跳轉對應的模板文件
'dispatch_error_tmpl' => APP_PATH . 'tpl/dispatch_jump.tpl',
//默認成功跳轉對應的模板文件
'dispatch_success_tmpl' => APP_PATH . 'tpl/dispatch_jump.tpl',