调整代码格式规范

This commit is contained in:
麦当苗儿
2013-04-15 11:47:51 +08:00
parent f83c8b0cb2
commit c021901409

View File

@@ -28,7 +28,6 @@ class View {
'http_cache_id' => null, 'http_cache_id' => null,
'view_path' => '', 'view_path' => '',
'view_suffix' => '.html', 'view_suffix' => '.html',
]; ];
/** /**
@@ -129,7 +128,7 @@ class View {
if(!is_file($template)) if(!is_file($template))
E('template file not exists:'.$template); E('template file not exists:'.$template);
} }
$vars = $vars?$vars:$this->data; $vars = $vars ? $vars : $this->data;
// 页面缓存 // 页面缓存
ob_start(); ob_start();
ob_implicit_flush(0); ob_implicit_flush(0);
@@ -157,13 +156,13 @@ class View {
// 获取当前主题名称 // 获取当前主题名称
$theme = $this->getTemplateTheme(); $theme = $this->getTemplateTheme();
// 分析模板文件规则 // 分析模板文件规则
if(''==$template) { if('' == $template) {
// 如果模板文件名为空 按照默认规则定位 // 如果模板文件名为空 按照默认规则定位
$template = CONTROLLER_NAME.'/'.ACTION_NAME; $template = CONTROLLER_NAME.'/'.ACTION_NAME;
}elseif(false === strpos($template,'/')){ }elseif(false === strpos($template,'/')){
$template = CONTROLLER_NAME.'/'.$template; $template = CONTROLLER_NAME.'/'.$template;
} }
return ($this->config['view_path']?$this->config['view_path']:MODULE_PATH.'View/').$theme.$template.$this->config['view_suffix']; return ($this->config['view_path'] ? $this->config['view_path'] : MODULE_PATH.'View/').$theme.$template.$this->config['view_suffix'];
} }
/** /**