Symfony\Cmf\Bundle\RoutingBundle\Model\Route::__construct PHP Method

__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
    public function __construct(array $options = array())
    {
        $this->setDefaults(array());
        $this->setRequirements(array());
        $this->setOptions($options);
        if ($this->getOption('add_format_pattern')) {
            $this->setDefault('_format', 'html');
            $this->setRequirement('_format', 'html');
        }
    }

Usage Example

Example #1
0
 /**
  * PHPCR id can not end on '/', so we need an additional option for a
  * trailing slash.
  *
  * Additional supported option is:
  *
  * * add_trailing_slash: When set, a trailing slash is appended to the route
  */
 public function __construct(array $options = array())
 {
     parent::__construct($options);
     $this->children = new ArrayCollection();
 }
All Usage Examples Of Symfony\Cmf\Bundle\RoutingBundle\Model\Route::__construct