ViewName.php 528B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace Illuminate\View;
  3. class ViewName
  4. {
  5. /**
  6. * Normalize the given event name.
  7. *
  8. * @param string $name
  9. * @return string
  10. */
  11. public static function normalize($name)
  12. {
  13. $delimiter = ViewFinderInterface::HINT_PATH_DELIMITER;
  14. if (strpos($name, $delimiter) === false) {
  15. return str_replace('/', '.', $name);
  16. }
  17. list($namespace, $name) = explode($delimiter, $name);
  18. return $namespace.$delimiter.str_replace('/', '.', $name);
  19. }
  20. }