Tabla de Contenidos

Tema anterior

< Class Phalcon\Mvc\Router\Route

Próximo tema

Class Phalcon\Mvc\Url\Exception >

Esta página

Class Phalcon\Mvc\Url

implements Phalcon\Mvc\UrlInterface, Phalcon\DI\InjectionAwareInterface

This components aids in the generation of: URIs, URLs and Paths


 //Generate a url appending a uri to the base Uri
 echo $url->get('products/edit/1');

 //Generate a url for a predefined route
 echo $url->get(array('for' => 'blog-post', 'title' => 'some-cool-stuff', 'year' => '2012'));


public setDI (Phalcon\DiInterface $dependencyInjector)

Sets the DependencyInjector container

public Phalcon\DiInterface getDI ()

Returns the DependencyInjector container

public setBaseUri (string $baseUri)

Sets a prefix to all the urls generated



public string getBaseUri ()

Returns the prefix for all the generated urls. By default /

public setBasePath (string $basePath)

Sets a base paths for all the generated paths



public string getBasePath ()

Returns a base path

public string get ([string|array $uri])

Generates a URL

public string path ([string $path])

Generates a local path