ARouter  0.1.0
Annotation based router for your projects
UrlBuilder Class Reference

Public Member Functions

 __construct ()
 
 fromPath (string $path, array $args)
 
 fromControllerMethod (string $controllerClass, string $method, array $args=[])
 

Detailed Description

Allows generating of URLs in a nice way.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

UrlBuilder constructor.

Member Function Documentation

◆ fromControllerMethod()

fromControllerMethod ( string  $controllerClass,
string  $method,
array  $args = [] 
)

Generate URL from controller and method name.

Parameters
string$controllerClassName of controller class.
string$methodName of controller's method.
array$argsPath arguments.
Returns
string Generated URL.
Exceptions

◆ fromPath()

fromPath ( string  $path,
array  $args 
)

Generate URL from path pattern.

Parameters
string$pathPath pattern.
array$argsPath arguments.
Returns
string Generated URL.
Exceptions
PathArgumentIsMissingExceptionIf path argument is missing for URL generation.

The documentation for this class was generated from the following file: