PathMatcher
class PathMatcher implements PathMatcherInterface (View source)
Provides a path matcher.
Properties
| protected bool | $isCurrentFrontPage | Whether the current page is the front page. |
|
| protected string | $frontPage | The default front page. |
|
| protected array | $regexes | The cache of regular expressions. |
|
| protected ConfigFactoryInterface | $configFactory | The config factory service. |
|
| protected RouteMatchInterface | $routeMatch | The current route match. |
Methods
__construct(ConfigFactoryInterface $config_factory, RouteMatchInterface $route_match)
Creates a new PathMatcher.
bool
matchPath(string $path, string $patterns)
Checks if a path matches any pattern in a set of patterns.
bool
isFrontPage()
Checks if the current page is the front page.
string
getFrontPagePath()
Gets the current front page path.
Details
__construct(ConfigFactoryInterface $config_factory, RouteMatchInterface $route_match)
Creates a new PathMatcher.
bool
matchPath(string $path, string $patterns)
Checks if a path matches any pattern in a set of patterns.
bool
isFrontPage()
Checks if the current page is the front page.
protected string
getFrontPagePath()
Gets the current front page path.