Dutch PHP Conference 2027

Yaf_Route_Static::match

(Yaf >=1.0.0)

Yaf_Route_Static::matchWhether the route matches a URI

Beschreibung

public function Yaf_Route_Static::match(string $uri): bool

Determine whether the static route matches a URI. Since the static route matches any URI, this method always returns true.

Parameter-Liste

uri

The URI to check.

Rückgabewerte

Always returns true.

Beispiele

Beispiel #1 Yaf_Route_Static::match() example

<?php
$route = new Yaf_Route_Static();

/* the static route matches any URI */
var_dump($route->match("/product/detail/id/10"));
var_dump($route->match("/"));
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

bool(true)
bool(true)

Siehe auch

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top