mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
代码格式调整
This commit is contained in:
@@ -27,6 +27,7 @@ class Controller {
|
|||||||
];
|
];
|
||||||
$this->view = new View();
|
$this->view = new View();
|
||||||
$this->view->engine('think', $config);
|
$this->view->engine('think', $config);
|
||||||
|
|
||||||
//控制器初始化
|
//控制器初始化
|
||||||
if(method_exists($this, '_initialize'))
|
if(method_exists($this, '_initialize'))
|
||||||
$this->_initialize();
|
$this->_initialize();
|
||||||
@@ -37,11 +38,11 @@ class Controller {
|
|||||||
* @access public
|
* @access public
|
||||||
* @param string $template 模板文件名
|
* @param string $template 模板文件名
|
||||||
* @param array $vars 模板输出变量
|
* @param array $vars 模板输出变量
|
||||||
* @param string $cacheId 模板缓存标识
|
* @param string $cache_id 模板缓存标识
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function display($template='',$vars=[],$cacheId=''){
|
public function display($template = '', $vars = [], $cache_id = ''){
|
||||||
$this->view->display($template,$vars,$cacheId);
|
$this->view->display($template, $vars, $cache_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -131,11 +132,11 @@ class Controller {
|
|||||||
* 默认跳转操作 支持错误导向和正确跳转
|
* 默认跳转操作 支持错误导向和正确跳转
|
||||||
* 调用模板显示 默认为public目录下面的success页面
|
* 调用模板显示 默认为public目录下面的success页面
|
||||||
* 提示页面为可配置 支持模板标签
|
* 提示页面为可配置 支持模板标签
|
||||||
|
* @access private
|
||||||
* @param string $message 提示信息
|
* @param string $message 提示信息
|
||||||
* @param Boolean $status 状态
|
* @param Boolean $status 状态
|
||||||
* @param string $jumpUrl 页面跳转地址
|
* @param string $jumpUrl 页面跳转地址
|
||||||
* @param mixed $ajax 是否为Ajax方式 当数字时指定跳转时间
|
* @param mixed $ajax 是否为Ajax方式 当数字时指定跳转时间
|
||||||
* @access private
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function dispatchJump($message, $status = 1, $jumpUrl = '', $ajax = false) {
|
private function dispatchJump($message, $status = 1, $jumpUrl = '', $ajax = false) {
|
||||||
@@ -165,7 +166,7 @@ class Controller {
|
|||||||
//发生错误时候默认停留3秒
|
//发生错误时候默认停留3秒
|
||||||
$this->view->assign('waitSecond', '3');
|
$this->view->assign('waitSecond', '3');
|
||||||
// 默认发生错误的话自动返回上页
|
// 默认发生错误的话自动返回上页
|
||||||
if(!$jumpUrl) $this->view->assign('jumpUrl',"javascript:history.back(-1);");
|
if(!$jumpUrl) $this->view->assign('jumpUrl', 'javascript:history.back(-1);');
|
||||||
$this->display(C('error_tmpl'));
|
$this->display(C('error_tmpl'));
|
||||||
// 中止执行 避免出错后继续执行
|
// 中止执行 避免出错后继续执行
|
||||||
exit ;
|
exit ;
|
||||||
|
|||||||
Reference in New Issue
Block a user