Ver Fonte

[Routing] added missing Route::setOption() method

Fabien Potencier há 14 anos atrás
pai
commit
48858cb95b
1 ficheiros alterados com 18 adições e 1 exclusões
  1. 18 1
      src/Symfony/Component/Routing/Route.php

+ 18 - 1
src/Symfony/Component/Routing/Route.php

@@ -99,12 +99,29 @@ class Route
     public function setOptions(array $options)
     {
         $this->options = array_merge(array(
-            'compiler_class'     => 'Symfony\\Component\\Routing\\RouteCompiler',
+            'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler',
         ), $options);
 
         return $this;
     }
 
+    /**
+     * Sets an option value.
+     *
+     * This method implements a fluent interface.
+     *
+     * @param string $name  An option name
+     * @param mixed  $value The option value
+     *
+     * @return Route The current Route instance
+     */
+    public function setOption($name, $value)
+    {
+        $this->options[$name] = $value;
+
+        return $this;
+    }
+
     /**
      * Get an option value.
      *