/** * 获得真正的视图文件名 * * @param string $file * @access protected * @return string */ protected function findFile($file) { $ext = $this->file_ext ?: 'php'; if (!is_file($file)) { // 不是绝对路径 $file = $this->view_dir . '/' . $file; } $pathinfo = pathinfo($file); if (!isset($pathinfo['extension']) || $pathinfo['extension'] != $ext) { $file .= '.' . $ext; } if (!($fullname = realpath($file))) { throw Error::file_not_found($file); } return $fullname; }