/rfinder

Checking an arbitrary URL for Micro-Framework HLEB

Primary LanguagePHPMIT LicenseMIT

Checking an arbitrary URL for Micro-Framework HLEB

The class RouteFinder is not included in the original configuration of the framework HLEB, so it must be copied to the folder with the vendor/phphleb libraries from the github.com/phphleb/rfinder repository or installed using Composer:

$ composer require phphleb/rfinder

Checking:

use Phphleb\Rfinder\RouteFinder;

if ((new RouteFinder('/example/url/address/', 'GET'))->isFound()) {
 // Found a match in all types of routes.
}

Separately:

use Phphleb\Rfinder\RadjaxRouteFinder;
use Phphleb\Rfinder\StandardRouteFinder;

$address = '/example/url/address/';

// Step 1
if ((new RadjaxRouteFinder($address))->isFound()) {
 // Found a match in the Radjax routes.
}

// Step 2
if ((new StandardRouteFinder($address, 'GET'))->isFound()) {
 // Found a match in the standard routes.
}

License: MIT PHP PHP PHP