本文整理汇总了PHP中F0FInflector::getPart方法的典型用法代码示例。如果您正苦于以下问题:PHP F0FInflector::getPart方法的具体用法?PHP F0FInflector::getPart怎么用?PHP F0FInflector::getPart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类F0FInflector
的用法示例。
在下文中一共展示了F0FInflector::getPart方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findRenderer
/**
* Finds a suitable renderer
*
* @return F0FRenderAbstract
*/
protected function findRenderer()
{
$filesystem = F0FPlatform::getInstance()->getIntegrationObject('filesystem');
// Try loading the stock renderers shipped with F0F
if (empty(self::$renderers) || !class_exists('F0FRenderJoomla', false)) {
$path = dirname(__FILE__) . '/../render/';
$renderFiles = $filesystem->folderFiles($path, '.php');
if (!empty($renderFiles)) {
foreach ($renderFiles as $filename) {
if ($filename == 'abstract.php') {
continue;
}
@(include_once $path . '/' . $filename);
$camel = F0FInflector::camelize($filename);
$className = 'F0FRender' . ucfirst(F0FInflector::getPart($camel, 0));
$o = new $className();
self::registerRenderer($o);
}
}
}
// Try to detect the most suitable renderer
$o = null;
$priority = 0;
if (!empty(self::$renderers)) {
foreach (self::$renderers as $r) {
$info = $r->getInformation();
if (!$info->enabled) {
continue;
}
if ($info->priority > $priority) {
$priority = $info->priority;
$o = $r;
}
}
}
// Return the current renderer
return $o;
}