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