You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
523 B
PHP
26 lines
523 B
PHP
<?php
|
|
|
|
namespace Illuminate\View;
|
|
|
|
class ViewName
|
|
{
|
|
/**
|
|
* Normalize the given view name.
|
|
*
|
|
* @param string $name
|
|
* @return string
|
|
*/
|
|
public static function normalize($name)
|
|
{
|
|
$delimiter = ViewFinderInterface::HINT_PATH_DELIMITER;
|
|
|
|
if (strpos($name, $delimiter) === false) {
|
|
return str_replace('/', '.', $name);
|
|
}
|
|
|
|
[$namespace, $name] = explode($delimiter, $name);
|
|
|
|
return $namespace.$delimiter.str_replace('/', '.', $name);
|
|
}
|
|
}
|