PathMatcherInterface.php 640 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Drupal\Core\Path;
  3. /**
  4. * Provides an interface for URL path matchers.
  5. */
  6. interface PathMatcherInterface {
  7. /**
  8. * Checks if a path matches any pattern in a set of patterns.
  9. *
  10. * @param string $path
  11. * The path to match.
  12. * @param string $patterns
  13. * A set of patterns separated by a newline.
  14. *
  15. * @return bool
  16. * TRUE if the path matches a pattern, FALSE otherwise.
  17. */
  18. public function matchPath($path, $patterns);
  19. /**
  20. * Checks if the current page is the front page.
  21. *
  22. * @return bool
  23. * TRUE if the current page is the front page.
  24. */
  25. public function isFrontPage();
  26. }