public function Url::__construct
public Url::__construct($route_name, $route_parameters = array(), $options = array())
Constructs a new Url object.
In most cases, use Url::fromRoute() or Url::fromUri() rather than constructing Url objects directly in order to avoid ambiguity and make your code more self-documenting.
@todo Update this documentation for non-routed URIs in https://www.drupal.org/node/2346787
Parameters
string $route_name: The name of the route
array $route_parameters: (optional) An associative array of parameter names and values.
array $options: See \Drupal\Core\Url::fromUri() for details.
See also
static::fromRoute()
static::fromUri()
File
- core/lib/Drupal/Core/Url.php, line 114
Class
- Url
- Defines an object that holds information about a URL.
Namespace
Drupal\CoreCode
public function __construct($route_name, $route_parameters = array(), $options = array()) { $this->routeName = $route_name; $this->routeParameters = $route_parameters; $this->options = $options; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Url.php/function/Url::__construct/8.1.x