https://github.com/phphleb/rfinder
Checking an arbitrary URL for Micro-Framework HLEB
https://github.com/phphleb/rfinder
Last synced: 5 months ago
JSON representation
Checking an arbitrary URL for Micro-Framework HLEB
- Host: GitHub
- URL: https://github.com/phphleb/rfinder
- Owner: phphleb
- License: mit
- Created: 2021-11-03T18:04:26.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-18T18:00:08.000Z (over 3 years ago)
- Last Synced: 2023-07-15T16:58:34.651Z (almost 3 years ago)
- Language: PHP
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
### Checking an arbitrary URL for Micro-Framework HLEB
The class `RouteFinder` is not included in the original configuration of the framework [HLEB](https://github.com/phphleb/hleb), so it must be copied to the folder with the vendor/phphleb libraries from the [github.com/phphleb/rfinder](https://github.com/phphleb/rfinder) repository or installed using Composer:
```bash
$ composer require phphleb/rfinder
```
Checking:
```php
use Phphleb\Rfinder\RouteFinder;
if ((new RouteFinder('/example/url/address/', 'GET'))->isFound()) {
// Found a match in all types of routes.
}
```
Separately:
```php
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.
}
```
-----------------------------------
[-brightgreen.svg)](https://github.com/phphleb/draft/blob/main/LICENSE)   