PHP Class Symfony\Cmf\Bundle\RoutingBundle\Model\Route

Inheritance: extends Symfony\Component\Routing\Route, implements Symfony\Cmf\Component\Routing\RouteObjectInterface
ファイルを表示 Open project: symfony-cmf/routing-bundle Class Usage Examples

Protected Properties

Property Type Description
$content object The referenced content object.
$id string Unique id of this route.
$needRecompile boolean State information not persisted in storage.
$staticPrefix string Note that this field is not used by PHPCR-ODM
$variablePattern string Variable pattern part. The static part of the pattern is the id without the prefix.

Public Methods

Method Description
__construct ( array $options = [] ) Overwrite to be able to create route without pattern.
compile ( )
getContent ( )
getId ( ) Get the repository path of this url entry.
getOption ( $name )
getOptions ( )
getPath ( )
getRouteKey ( )
getStaticPrefix ( ) : string
getVariablePattern ( ) : string
setContent ( mixed $object ) Set the object this url points to.
setOptions ( array $options )
setPath ( $pattern )
setStaticPrefix ( string $prefix ) : Route
setVariablePattern ( string $variablePattern ) : Route

Protected Methods

Method Description
isBooleanOption ( string $name ) Helper method to check if an option is a boolean option to allow better forms.

Method Details

__construct() public method

Additional supported options are: * add_format_pattern: When set, ".{_format}" is appended to the route pattern. Also implicitly sets a default/require on "_format" to "html". * add_locale_pattern: When set, "/{_locale}" is prepended to the route pattern.
public __construct ( array $options = [] )
$options array

compile() public method

Overwritten to make sure the route is recompiled if the pattern was changed
public compile ( )

getContent() public method

public getContent ( )

getId() public method

Get the repository path of this url entry.
public getId ( )

getOption() public method

Handling the missing default 'compiler_class'
See also: setOptions
public getOption ( $name )

getOptions() public method

Handling the missing default 'compiler_class'
See also: setOptions
public getOptions ( )

getPath() public method

public getPath ( )

getRouteKey() public method

public getRouteKey ( )

getStaticPrefix() public method

public getStaticPrefix ( ) : string
return string the static prefix part of this route

getVariablePattern() public method

public getVariablePattern ( ) : string
return string the variable part of the url pattern

isBooleanOption() protected method

Helper method to check if an option is a boolean option to allow better forms.
protected isBooleanOption ( string $name )
$name string

setContent() public method

Set the object this url points to.
public setContent ( mixed $object )
$object mixed A content object that can be persisted by the storage layer.

setOptions() public method

Prevent setting the default 'compiler_class' so that we do not persist it
public setOptions ( array $options )
$options array

setPath() public method

It is recommended to use setVariablePattern to just set the part after the static part. If you use this method, it will ensure that the static part is not changed and only change the variable part. When using PHPCR-ODM, make sure to persist the route before calling this to have the id field initialized.
public setPath ( $pattern )

setStaticPrefix() public method

public setStaticPrefix ( string $prefix ) : Route
$prefix string The static prefix part of this route
return Route $this

setVariablePattern() public method

public setVariablePattern ( string $variablePattern ) : Route
$variablePattern string the variable part of the url pattern
return Route

Property Details

$content protected_oe property

The referenced content object.
protected object $content
return object

$id protected_oe property

Unique id of this route.
protected string $id
return string

$needRecompile protected_oe property

State information not persisted in storage.
protected bool $needRecompile
return boolean

$staticPrefix protected_oe property

Note that this field is not used by PHPCR-ODM
protected string $staticPrefix
return string

$variablePattern protected_oe property

Variable pattern part. The static part of the pattern is the id without the prefix.
protected string $variablePattern
return string