本文整理汇总了PHP中Twig_Loader_Filesystem::normalizeName方法的典型用法代码示例。如果您正苦于以下问题:PHP Twig_Loader_Filesystem::normalizeName方法的具体用法?PHP Twig_Loader_Filesystem::normalizeName怎么用?PHP Twig_Loader_Filesystem::normalizeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Twig_Loader_Filesystem
的用法示例。
在下文中一共展示了Twig_Loader_Filesystem::normalizeName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: normalizeName
public function normalizeName($name)
{
if (substr($name, -5) !== '.twig') {
$name .= '.twig';
}
return parent::normalizeName($name);
// TODO: Change the autogenerated stub
}
示例2: normalizeName
protected function normalizeName($name)
{
if (strpos($name, '::') !== false) {
$exploded = explode('::', $name);
if (count($exploded) === 2) {
$name = $exploded[1];
}
}
return parent::normalizeName($name);
}
示例3: normalizeName
/**
* @param $name
* @return mixed|string
*/
protected function normalizeName($name)
{
$name = parent::normalizeName($name);
if ($ext = $this->getExt()) {
$suffix = '.' . $ext;
if (substr($name, -strlen($suffix)) !== $suffix) {
$name .= $suffix;
}
}
return $name;
}
示例4: normalizeName
public function normalizeName($name)
{
$name .= ".twig";
return parent::normalizeName($name);
// TODO: Change the autogenerated stub
}
示例5: normalizeName
/**
* Преобразует имя в максимально-полное начертание
*
* @param string $name
* @return string
*/
public function normalizeName($name)
{
if (strpos($name, '/') !== false) {
return parent::normalizeName($name);
}
if (isset(static::$normalized[$name])) {
return static::$normalized[$name];
}
//Убираем все повторяющиеся двоеточия
$name = preg_replace('#/{2,}#', ':', (string) $name);
list($namespace, $component, $template, $file) = explode(':', $name);
if (strlen($template) === 0) {
$template = '.default';
}
if (strlen($file) === 0) {
$file = 'template';
}
$normalizedName = "{$namespace}:{$component}:{$template}:{$file}";
static::$normalized[$name] = $normalizedName;
return $normalizedName;
}