本文整理汇总了PHP中FOFInflector::getPart方法的典型用法代码示例。如果您正苦于以下问题:PHP FOFInflector::getPart方法的具体用法?PHP FOFInflector::getPart怎么用?PHP FOFInflector::getPart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FOFInflector
的用法示例。
在下文中一共展示了FOFInflector::getPart方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findRenderer
/**
* Finds a suitable renderer
*
* @return FOFRenderAbstract
*/
protected function findRenderer()
{
$filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem');
// Try loading the stock renderers shipped with FOF
if (empty(self::$renderers) || !class_exists('FOFRenderJoomla', 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 = FOFInflector::camelize($filename);
$className = 'FOFRender' . ucfirst(FOFInflector::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;
}