UrlType

class UrlType extends AbstractType Methods buildForm(FormBuilderInterface $builder, array $options) Builds the form. buildView(FormView $view, FormInterface $form, array $options) Builds the form view. from AbstractType finishView(FormView $view, FormInterface $form, array $options) Finishes the form view. from AbstractType configureOptions(OptionsResolver $resolver) Configures the options for this type. string getBlockPrefix() Returns the prefix of the template block nam

UrlPackage::getUrl()

string getUrl(string $path) Returns an absolute or root-relative public path. Parameters string $path A path Return Value string The public path

UrlPackage::getBaseUrl()

string getBaseUrl(string $path) Returns the base URL for a path. Parameters string $path Return Value string The base URL

UrlPackage deprecated::getUrl()

string getUrl(string $path, string|bool|null $version = null) Returns an absolute or root-relative public path. Parameters string $path A path string|bool|null $version A specific version for the path Return Value string The public path

UrlPackage deprecated::getBaseUrl()

string getBaseUrl(string $path) Returns the base URL for a path. Parameters string $path Return Value string The base URL

UrlPackage deprecated

class UrlPackage extends Package deprecated since 2.7, will be removed in 3.0. Use the Asset component instead. The URL packages adds a version and a base URL to asset URLs. Methods __construct(string|array $baseUrls = array(), string $version = null, string $format = null) Constructor. string getVersion() Returns the asset package version. from Package string getUrl(string $path, string|bool|null $version = null) Returns an absolute or root-relative public path. string

UrlPackage

class UrlPackage extends Package Package that adds a base URL to asset URLs in addition to a version. The package allows to use more than one base URLs in which case it randomly chooses one for each asset; it also guarantees that any given path will always use the same base URL to be nice with HTTP caching mechanisms. When the request context is available, this package can choose the best base URL to use based on the current request scheme: For HTTP request, it chooses between all base URLs;

UrlMatcherInterface

interface UrlMatcherInterface implements RequestContextAwareInterface UrlMatcherInterface is the interface that all URL matcher classes must implement. Methods setContext(RequestContext $context) Sets the request context. from RequestContextAwareInterface RequestContext getContext() Gets the request context. from RequestContextAwareInterface array match(string $pathinfo) Tries to match a URL path with a set of routes. Details setContext(RequestCon

UrlMatcher::setContext()

setContext(RequestContext $context) Sets the request context. Parameters RequestContext $context The context

UrlMatcher::matchRequest()

array matchRequest(Request $request) Tries to match a request with a set of routes. If the matcher can not find information, it must throw one of the exceptions documented below. Parameters Request $request The request to match Return Value array An array of parameters Exceptions ResourceNotFoundException If no matching resource could be found MethodNotAllowedException If a matching resource was found but the request method is not allowed