Overview

Namespaces

  • Evenement
  • None
  • PHP
  • Psr
    • Http
      • Message
  • Ratchet
    • Http
    • RFC6455
      • Handshake
      • Messaging
    • Server
    • Session
      • Serialize
      • Storage
        • Proxy
    • Wamp
    • WebSocket
  • React
    • EventLoop
      • Tick
      • Timer
    • Socket
    • Stream
  • Symfony
    • Component
      • HttpFoundation
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
      • Routing
        • Annotation
        • Exception
        • Generator
          • Dumper
        • Loader
          • DependencyInjection
        • Matcher
          • Dumper
        • Tests
          • Annotation
          • Fixtures
            • AnnotatedClasses
            • OtherAnnotatedClasses
          • Generator
            • Dumper
          • Loader
          • Matcher
            • Dumper

Classes

  • CompiledRoute
  • RequestContext
  • Route
  • RouteCollection
  • RouteCollectionBuilder
  • RouteCompiler
  • Router

Interfaces

  • RequestContextAwareInterface
  • RouteCompilerInterface
  • RouterInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class RouteCollectionBuilder

Helps add and import routes into a RouteCollection.

Namespace: Symfony\Component\Routing
Author: Ryan Weaver <ryan@knpuniversity.com>
Located at RouteCollectionBuilder.php
Methods summary
public
# __construct( Symfony\Component\Config\Loader\LoaderInterface $loader = null )

Parameters

$loader
Symfony\Component\Config\Loader\LoaderInterface
$loader
public Symfony\Component\Routing\RouteCollectionBuilder
# import( mixed $resource, string|null $prefix = '/', string $type = null )

Import an external routing resource and returns the RouteCollectionBuilder.

Import an external routing resource and returns the RouteCollectionBuilder.

$routes->import('blog.yml', '/blog');

Parameters

$resource
mixed
$resource
$prefix
string|null
$prefix
$type
string
$type

Returns

Symfony\Component\Routing\RouteCollectionBuilder

Throws

Symfony\Component\Config\Exception\FileLoaderLoadException
public Symfony\Component\Routing\Route
# add( string $path, string $controller, string|null $name = null )

Adds a route and returns it for future modification.

Adds a route and returns it for future modification.

Parameters

$path
string
$path The route path
$controller
string
$controller The route's controller
$name
string|null
$name The name to give this route

Returns

Symfony\Component\Routing\Route
public Symfony\Component\Routing\RouteCollectionBuilder
# createBuilder( )

Returns a RouteCollectionBuilder that can be configured and then added with mount().

Returns a RouteCollectionBuilder that can be configured and then added with mount().

Returns

Symfony\Component\Routing\RouteCollectionBuilder
public
# mount( string $prefix, Symfony\Component\Routing\RouteCollectionBuilder $builder )

Add a RouteCollectionBuilder.

Add a RouteCollectionBuilder.

Parameters

$prefix
string
$prefix
$builder
Symfony\Component\Routing\RouteCollectionBuilder
$builder
public mixed
# addRoute( Symfony\Component\Routing\Route $route, string|null $name = null )

Adds a Route object to the builder.

Adds a Route object to the builder.

Parameters

$route
Symfony\Component\Routing\Route
$route
$name
string|null
$name

Returns

mixed
$this
public mixed
# setHost( string $pattern )

Sets the host on all embedded routes (unless already set).

Sets the host on all embedded routes (unless already set).

Parameters

$pattern
string
$pattern

Returns

mixed
$this
public mixed
# setCondition( string $condition )

Sets a condition on all embedded routes (unless already set).

Sets a condition on all embedded routes (unless already set).

Parameters

$condition
string
$condition

Returns

mixed
$this
public mixed
# setDefault( string $key, mixed $value )

Sets a default value that will be added to all embedded routes (unless that default value is already set).

Sets a default value that will be added to all embedded routes (unless that default value is already set).

Parameters

$key
string
$key
$value
mixed
$value

Returns

mixed
$this
public mixed
# setRequirement( string $key, mixed $regex )

Sets a requirement that will be added to all embedded routes (unless that requirement is already set).

Sets a requirement that will be added to all embedded routes (unless that requirement is already set).

Parameters

$key
string
$key
$regex
mixed
$regex

Returns

mixed
$this
public mixed
# setOption( string $key, mixed $value )

Sets an opiton that will be added to all embedded routes (unless that option is already set).

Sets an opiton that will be added to all embedded routes (unless that option is already set).

Parameters

$key
string
$key
$value
mixed
$value

Returns

mixed
$this
public mixed
# setSchemes( array|string $schemes )

Sets the schemes on all embedded routes (unless already set).

Sets the schemes on all embedded routes (unless already set).

Parameters

$schemes
array|string
$schemes

Returns

mixed
$this
public mixed
# setMethods( array|string $methods )

Sets the methods on all embedded routes (unless already set).

Sets the methods on all embedded routes (unless already set).

Parameters

$methods
array|string
$methods

Returns

mixed
$this
public Symfony\Component\Routing\RouteCollection
# build( )

Creates the final RouteCollection and returns it.

Creates the final RouteCollection and returns it.

Returns

Symfony\Component\Routing\RouteCollection
Ratchet API documentation generated by ApiGen 2.8.0