Files
simple-php-router/tests/Pecee/SimpleRouter/Dummy/Managers/FindUrlBootManager.php
Simon Sessingø 801f1e68cc [BUGFIX] BootManager findRoute not working.
- Fixed findRoute not working in BootManager as reported by issue: #448
- Added more comprehensive php-unit tests for bootmanagers including findUrl.
2021-03-22 18:05:27 +01:00

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;
}
}
}