本文整理匯總了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;
}