系统出现异常

异常位置: FILE: /data/home/byu3312960001/htdocs/coolphp/view.php LINE: 14

[ 提示信息 ]

视图[cases/index]不存在!

[ 详情 ]

请求网址:/index.php
12: */
13:
14: class View extends Base{ public $app; public $layout; public $name; public $vars = array (); public $block = array(); public $ext = '.php'; public $content; public static function loadView(){ static $view; if(isset($view)) return $view; $adapter = c('view_adapter'); $className = ucwords($adapter); if( $adapter && class_exists($className) ){ $view = new $className( g('__app') ); }elseif(class_exists('AppView')){ $view = new AppView( g('__app') ); }else{ $view = new View( g('__app') ); } return $view; } public function __construct($app){ $this->app = $app; } public function __destruct() { $this->app = null; } public function assign($name, $value = null) { if (is_array($name) && is_null($value)) { $this->vars = array_merge($this->vars, $name); } else { $this->vars[$name] = $value; } } public function layout($layout){ $this->layout = $layout; } public function startBlock( $name ){ ob_start(); } public function endBlock($name,$callbacks=array()){ $out = ob_get_contents(); ob_end_clean(); if(!empty($callbacks)){ $callbacks = is_string($callbacks) ? explode('|',$callbacks) : $callbacks; foreach($callbacks as $callback=>$params){ if( is_int($callback) ){ $callback = $params; $params = array(); } if(is_string($params)) $params = array($params); if( !function_exists($callback) ) continue; array_unshift($params,$out); $out = call_user_func_array($callback,$params); } } if(isset($this->block[$name])){ $this->block[$name] = $this->block[$name].$out; }else{ $this->block[$name] = $out; } return $this->block[$name]; } public function loadBlock($name){ if(isset($this->block[$name])) return $this->block[$name]; return null; } public function clearBlock($name=null){ if($name==null) $this->block = array(); foreach($name as $v){ unset( $this->block[$v] ); } } public function load($name, $param = array (),$expire=0,$cacheId=null) { $cache = null; if( $expire>0) { $cacheId = $cacheId==null ? unid(array ( 'code' => 'it_being_cool_php_load_view_cache', 'name' => $name, 'param' => $param, 'expire' => $expire )) : $cacheId; $cache = Cache :: getInstance(); if($cache && ($result = $cache->get($cacheId))!==false){ return $result; } } try{ ob_start(); extract($param, EXTR_SKIP); $viewFile = $this->_getViewFile($name); include($viewFile); $html = ob_get_contents(); ob_end_clean(); }catch(Exception $ex){ if(c('app_model')!='product'){ return nl2br($ex); } return false; } if($cache){ $cache->set($cacheId,$html,$expire); } return $html; } public function display( $name=null,$vars=array() ) { if(!empty($name))$this->name = $name; if(!empty($vars)) $this->assign( $vars ); if($this->_beforeDisplay()){ $viewFile = $this->_getViewFile($name); extract($this->vars, EXTR_SKIP); ob_start(); include($viewFile); $this->content = ob_get_contents(); ob_end_clean(); if($this->layout){ $viewFile = $this->_getViewFile($this->layout); ob_start(); include ($viewFile); $this->content = ob_get_contents(); ob_end_clean(); } } if( $this->_afterDisplay() ){ return $this->content; } return null; } protected function _beforeDisplay(){ return true; } protected function _afterDisplay(){ if(c('app_model')=='product'){ $this->content = trim( str_replace( array("\t","\r","\r\t"),"",$this->content ) ); $this->content = preg_replace("~>\s+\r~", ">", preg_replace("~>\s+\n~", ">", $this->content)); $this->content = preg_replace("~>\s+<~", "><", $this->content); } return true; } protected function _getViewFile($name){ $dir = c('view_dir'); if( file_exists( APP_PATH.DS.$dir.DS.$name.$this->ext )){ return APP_PATH.DS.$dir.DS.$name.$this->ext; }elseif( file_exists( APP_PATH.DS.$dir.DS.$this->app->controllerName.DS.$name.$this->ext )){ return APP_PATH.DS.$dir.DS.$this->app->controllerName.DS.$name.$this->ext; } throw new CLException('ViewNotFound',$name); } } ?>15:16:

CoolPHP 1.0 { 欢迎使用CoolPHP MVC开发架构 } -- [ It being cool... ]