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\TraitsCode
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);
}