Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AddTrait.php

function AddTrait::add

Adds a route.

Parameters

string|array $path the path, or the localized paths of the route:

1 call to AddTrait::add()
AddTrait::__invoke in vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php
Adds a route.

File

vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php, line 35

Class

AddTrait
@author Nicolas Grekas <p@tchwork.com>

Namespace

Symfony\Component\Routing\Loader\Configurator\Traits

Code

public function add(string $name, string|array $path) : RouteConfigurator {
    $parentConfigurator = $this instanceof CollectionConfigurator ? $this : ($this instanceof RouteConfigurator ? $this->parentConfigurator : null);
    $route = $this->createLocalizedRoute($this->collection, $name, $path, $this->name, $this->prefixes);
    return new RouteConfigurator($this->collection, $route, $this->name, $parentConfigurator, $this->prefixes);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal