文件管理的现实页面是有控制器中index决定的请问下面红色的部分是什么意思啊?关键是那个_values我用的代码后根本不显示,显示为空页面,代码如下:
public function index(){
import("ORG.Io.Dir");
//路径构造
if((!$_GET['path'] && !$_GET['up'] && !$_SESSION['path'])||$_GET['root']) $_SESSION['path'] = $_SERVER['DOCUMENT_ROOT'];
if($_GET['path']) $_SESSION['path'] = $_SESSION['path'].'/'.$_GET['path'];
$_SESSION['path'] = str_replace('//', '/', $_SESSION['path']);
$path = $_SESSION['path'];
//返回上层目录
if($_GET['up']){
//限制在网站根目录
if(strlen($path)>strlen($_SERVER['DOCUMENT_ROOT'])){
preg_match('/^.*\//', $path, $match);
$path = substr($match[0],0,-1);
$_SESSION['path'] = $path;
}else{
$_SESSION['path'] = $_SERVER['DOCUMENT_ROOT'];
}
}
$dir = new Dir($path);
$list = $dir->_values;
dump($list);
foreach ($list as $key => $val){
$list[$key]['fileimg'] = $this->getFileImg($val);
}
$this->assign('list',$list);
$this->display();
}
public function index(){
import("ORG.Io.Dir");
//路径构造
if((!$_GET['path'] && !$_GET['up'] && !$_SESSION['path'])||$_GET['root']) $_SESSION['path'] = $_SERVER['DOCUMENT_ROOT'];
if($_GET['path']) $_SESSION['path'] = $_SESSION['path'].'/'.$_GET['path'];
$_SESSION['path'] = str_replace('//', '/', $_SESSION['path']);
$path = $_SESSION['path'];
//返回上层目录
if($_GET['up']){
//限制在网站根目录
if(strlen($path)>strlen($_SERVER['DOCUMENT_ROOT'])){
preg_match('/^.*\//', $path, $match);
$path = substr($match[0],0,-1);
$_SESSION['path'] = $path;
}else{
$_SESSION['path'] = $_SERVER['DOCUMENT_ROOT'];
}
}
$dir = new Dir($path);
$list = $dir->_values;
dump($list);
foreach ($list as $key => $val){
$list[$key]['fileimg'] = $this->getFileImg($val);
}
$this->assign('list',$list);
$this->display();
}
$list = $dir->getIterator();
object(ArrayObject)#4 (1) {
["storage":"ArrayObject":private] => array(28) {
[0] => array(18) {
["filename"] => string(8) "yuanblog"
["pathname"] => string(20) "F:\wamp\www\yuanblog"
["owner"] => int(0)
["perms"] => int(16895)
["inode"] => int(0)
["group"] => int(0)
["path"] => string(11) "F:/wamp/www"
["atime"] => int(1312255798)
["ctime"] => int(1312255798)
["size"] => int(0)
["type"] => string(3) "dir"
["ext"] => string(0) ""
["mtime"] => int(1312255798)
["isDir"] => bool(true)
["isFile"] => bool(false)
["isLink"] => bool(false)
["isReadable"] => bool(true)
["isWritable"] => bool(true)
}
[1] => array(18) {
["filename"] => string(3) "bbb"
["pathname"] => string(15) "F:\wamp\www\bbb"
["owner"] => int(0)
["perms"] => int(16895)
["inode"] => int(0)
["group"] => int(0)
["path"] => string(11) "F:/wamp/www"
["atime"] => int(1313063512)
["ctime"] => int(1312255725)
["size"] => int(0)
["type"] => string(3) "dir"
["ext"] => string(0) ""
["mtime"] => int(1313063512)
["isDir"] => bool(true)
["isFile"] => bool(false)