本文整理汇总了PHP中RecursiveDirectoryIterator::getCTime方法的典型用法代码示例。如果您正苦于以下问题:PHP RecursiveDirectoryIterator::getCTime方法的具体用法?PHP RecursiveDirectoryIterator::getCTime怎么用?PHP RecursiveDirectoryIterator::getCTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecursiveDirectoryIterator
的用法示例。
在下文中一共展示了RecursiveDirectoryIterator::getCTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
parent::index();
$album = empty($this->parameters) ? "" : array_shift($this->parameters);
$dir = new \RecursiveDirectoryIterator(dirname(__DIR__) . $this->basedir . $album);
if (empty($album)) {
$albums = array();
foreach ($dir as $name => $object) {
$shortname = basename($name);
if ($shortname != ".." && $shortname != ".") {
$temp_album = new \DirectoryIterator($name);
foreach ($temp_album as $img) {
if ($img->isFile()) {
break;
}
}
$albums[$dir->getCTime()] = array("name" => $shortname, "image" => $this->basedir . $shortname . "/" . $img, "link" => "/fotos/index/" . $shortname);
}
}
ksort($albums);
$this->context["albums"] = $albums;
} else {
$pictures = array();
foreach ($dir as $image) {
$shortname = basename($image);
if ($shortname != ".." && $shortname != ".") {
$pictures[] = $this->basedir . $album . "/" . $shortname;
}
}
$this->context["pictures"] = $pictures;
$this->context["album"] = $album;
}
}