本文整理汇总了PHP中Symfony\Component\HttpFoundation\ParameterBag::count方法的典型用法代码示例。如果您正苦于以下问题:PHP ParameterBag::count方法的具体用法?PHP ParameterBag::count怎么用?PHP ParameterBag::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\HttpFoundation\ParameterBag
的用法示例。
在下文中一共展示了ParameterBag::count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLayoutFile
/**
* Return the file path to current layout, try to create it if not exists.
*
* @param Layout $layout
*
* @return string the file path
*
* @throws RendererException
*/
protected function getLayoutFile(Layout $layout)
{
$layoutfile = $layout->getPath();
if (null === $layoutfile && 0 < $this->manageableExt->count()) {
$adapter = null;
if (null !== $this->defaultAdapter && null !== ($adapter = $this->rendererAdapters->get($this->defaultAdapter))) {
$extensions = $adapter->getManagedFileExtensions();
} else {
$extensions = $this->manageableExt->keys();
}
if (0 === count($extensions)) {
throw new RendererException('Declared adapter(s) (count:' . $this->rendererAdapters->count() . ') is/are not able to manage ' . 'any file extensions at moment.');
}
$layoutfile = StringUtils::toPath($layout->getLabel(), array('extension' => reset($extensions)));
$layout->setPath($layoutfile);
}
return $layoutfile;
}