本文整理汇总了PHP中Dir::getFolders方法的典型用法代码示例。如果您正苦于以下问题:PHP Dir::getFolders方法的具体用法?PHP Dir::getFolders怎么用?PHP Dir::getFolders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dir
的用法示例。
在下文中一共展示了Dir::getFolders方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
// Reject class names that aren't valid
if (!ctype_alnum($class)) {
continue;
}
if ($classConfig = Classes_Meta::getConfig($class)) {
echo '
<tr>
<td style="max-width:100px; overflow:hidden;"><a href="/admin/Class/Class Details/' . $class . '">' . $class . '</a></td>
<td>' . $classConfig->description . '</td>
</tr>';
}
}
echo '
</table>';
// Scan through the plugins directory
$classs = Dir::getFolders(CORE_PLUGIN_PATH);
echo '
<h3 style="margin-top:22px;">Core Classes</h3>
<table class="mod-table">';
foreach ($classs as $class) {
// Reject class names that aren't valid
if (!ctype_alnum($class)) {
continue;
}
if ($classConfig = Classes_Meta::getConfig($class)) {
echo '
<tr>
<td style="max-width:100px; overflow:hidden;"><a href="/admin/Class/Class Details/' . $class . '">' . $class . '</a></td>
<td>' . $classConfig->description . '</td>
</tr>';
}
示例2: getClassList
public static function getClassList($dir = "")
{
// If a directory is provided, ONLY look through that directory for plugins
if ($dir !== "") {
$dir = rtrim(Sanitize::filepath($dir), "/");
return Dir::getFolders($dir);
}
// Get the full list of available plugins
$classes = Dir::getFolders(APP_PATH . "/classes");
$classes = array_merge(Dir::getFolders(SYS_PATH . "/core-classes"), $classes);
$classes = array_merge(Dir::getFolders(SYS_PATH . "/plugin-classes"), $classes);
return $classes;
}