mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-15 18:23:26 +03:00
- Fixed findRoute not working in BootManager as reported by issue: #448 - Added more comprehensive php-unit tests for bootmanagers including findUrl.
26 lines
593 B
PHP
26 lines
593 B
PHP
<?php
|
|
|
|
class FindUrlBootManager implements \Pecee\SimpleRouter\IRouterBootManager
|
|
{
|
|
protected $result;
|
|
|
|
public function __construct(&$result)
|
|
{
|
|
$this->result = &$result;
|
|
}
|
|
|
|
/**
|
|
* Called when router loads it's routes
|
|
*
|
|
* @param \Pecee\SimpleRouter\Router $router
|
|
* @param \Pecee\Http\Request $request
|
|
*/
|
|
public function boot(\Pecee\SimpleRouter\Router $router, \Pecee\Http\Request $request): void
|
|
{
|
|
$contact = $router->findRoute('contact');
|
|
|
|
if($contact !== null) {
|
|
$this->result = true;
|
|
}
|
|
}
|
|
} |