CurrentRouteMatch::getParameter

public function CurrentRouteMatch::getParameter

public CurrentRouteMatch::getParameter($parameter_name)

Returns the processed value of a named route parameter.

Raw URL parameters are processed by the parameter conversion system, which does operations such as converting entity ID parameters to fully-loaded entities. For example, the path node/12345 would have a raw node ID parameter value of 12345, while the processed parameter value would be the corresponding loaded node object.

Parameters

string $parameter_name: The parameter name.

Return value

mixed|null The parameter value. NULL if the route doesn't define the parameter or if the parameter value can't be determined from the request.

Overrides RouteMatchInterface::getParameter

See also

\Drupal\Core\Routing\RouteMatchInterface::getRawParameter()

File

core/lib/Drupal/Core/Routing/CurrentRouteMatch.php, line 55

Class

CurrentRouteMatch
Default object for current_route_match service.

Namespace

Drupal\Core\Routing

Code

public function getParameter($parameter_name) {
  return $this->getCurrentRouteMatch()->getParameter($parameter_name);
}

© 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!Routing!CurrentRouteMatch.php/function/CurrentRouteMatch::getParameter/8.1.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部