mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 10:22:12 +00:00
1c515119b4
- Ensure that request-method is always lowercase. - Fixed spaces instead of tabs to comply with PSR-2.
54 lines
1.2 KiB
PHP
54 lines
1.2 KiB
PHP
<?php
|
|
namespace Pecee\SimpleRouter\Route;
|
|
|
|
use Pecee\Http\Request;
|
|
|
|
interface ILoadableRoute extends IRoute
|
|
{
|
|
/**
|
|
* Find url that matches method, parameters or name.
|
|
* Used when calling the url() helper.
|
|
*
|
|
* @param string|null $method
|
|
* @param array|null $parameters
|
|
* @param string|null $name
|
|
* @return string
|
|
*/
|
|
public function findUrl($method = null, $parameters = null, $name = null);
|
|
|
|
/**
|
|
* Loads and renders middlewares-classes
|
|
*
|
|
* @param Request $request
|
|
* @param ILoadableRoute $route
|
|
*/
|
|
public function loadMiddleware(Request $request, ILoadableRoute &$route);
|
|
|
|
public function getUrl();
|
|
|
|
public function setUrl($url);
|
|
|
|
/**
|
|
* Returns the provided name for the router.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getName();
|
|
|
|
/**
|
|
* Check if route has given name.
|
|
*
|
|
* @param string $name
|
|
* @return bool
|
|
*/
|
|
public function hasName($name);
|
|
|
|
/**
|
|
* Sets the router name, which makes it easier to obtain the url or router at a later point.
|
|
*
|
|
* @param string $name
|
|
* @return static $this
|
|
*/
|
|
public function setName($name);
|
|
|
|
} |