You are here

public function RulesUiConfigHandler::getUrlFromRoute in Rules 8.3

Gets an URL for a Rules UI route.

Parameters

string $route_suffix: The Rules UI route suffix that is appended to the base route. Supported routes are:

  • expression.add: The add expression form.
  • expression.edit: The edit expression form.
  • expression.delete: The delete expression form.
  • break.lock: The break lock form.

array $route_parameters: (optional) An associative array of route parameter names and values. Depending on the route, the required parameters are:

  • expression-id: The expression plugin to add on expression.add.
  • uuid: The UUID of the expression to be edited or deleted.

array $options: (optional) Options for generating the URL, as supported by \Drupal\Core\Url::fromRoute().

Return value

\Drupal\Core\Url The URL of the given route.

Overrides RulesUiHandlerInterface::getUrlFromRoute

See also

\Drupal\rules\Routing\RulesUiRouteSubscriber::registerRoutes()

File

src/Ui/RulesUiConfigHandler.php, line 151

Class

RulesUiConfigHandler
The default handler for RulesUi plugins that store to config.

Namespace

Drupal\rules\Ui

Code

public function getUrlFromRoute($route_suffix, array $route_parameters, array $options = []) {

  // @see \Drupal\Core\Url::fromRouteMatch()
  return Url::fromRoute($this->pluginDefinition->base_route . '.' . $route_suffix, $route_parameters + $this->currentRouteMatch
    ->getRawParameters()
    ->all(), $options);
}