Overview

Namespaces

  • Autarky
    • Config
      • Loaders
    • Console
    • Container
      • Exception
      • Factory
      • Proxy
    • Database
    • Errors
    • Events
    • Files
    • Http
    • Logging
    • Providers
    • Routing
      • Events
    • Testing
    • TwigTemplating
      • Extensions
    • Utils

Classes

  • Configuration
  • Controller
  • DefaultRouteConfigurator
  • Route
  • RoutePathGenerator
  • Router
  • RoutingProvider
  • UrlGenerator

Interfaces

  • InvokerInterface
  • RoutePathGeneratorInterface
  • RouterInterface

Traits

  • ControllerTrait
  • Overview
  • Namespace
  • Class

Class UrlGenerator

URL generator.

Namespace: Autarky\Routing
Located at Routing/UrlGenerator.php
Methods summary
public
# __construct( Autarky\Routing\Router $router, Autarky\Routing\RoutePathGeneratorInterface $routePathGenerator, Symfony\Component\HttpFoundation\RequestStack $requests, boolean $validateParams = false )

Parameters

$router
$routePathGenerator
$requests
$validateParams
public
# setAssetRoot( string $assetRoot )

Set the root URL for assets. Useful if you're using CDNs.

Set the root URL for assets. Useful if you're using CDNs.

Parameters

$assetRoot
public
# setValidateParams( boolean $validateParams )

Set whether the regex pattern of route parameters should be validated on runtime.

Set whether the regex pattern of route parameters should be validated on runtime.

Parameters

$validateParams
public string
# getRouteUrl( string $name, array $params = array(), boolean $relative = false )

Get the URL to a named route.

Get the URL to a named route.

Parameters

$name
$params
$relative

Returns

string
public string
# getAssetUrl( string $path, boolean $relative = false )

Get the URL to an asset.

Get the URL to an asset.

Parameters

$path
$relative

Returns

string
public string
# getRootUrl( )

Get the root URL. Used to generate URLs to assets.

Get the root URL. Used to generate URLs to assets.

Returns

string
Properties summary
protected Autarky\Routing\Router $router
#
protected Autarky\Routing\RoutePathGeneratorInterface $routePathGenerator
#
protected Symfony\Component\HttpFoundation\RequestStack $requests
#
protected null|string $assetRoot

The root URL to use for assets, if any.

The root URL to use for assets, if any.

#
Autarky Framework API documentation generated by ApiGen