Browse Source

[Routing] makes the parameters argument of generate() optional

Fabien Potencier 14 years ago
parent
commit
4de468e181

+ 1 - 1
src/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php

@@ -79,7 +79,7 @@ EOF
 
         return <<<EOF
 
-    public function generate(\$name, array \$parameters, \$absolute = false)
+    public function generate(\$name, array \$parameters = array(), \$absolute = false)
     {
         if (!isset(self::\$declaredRouteNames[\$name])) {
             throw new \InvalidArgumentException(sprintf('Route "%s" does not exist.', \$name));

+ 1 - 1
src/Symfony/Component/Routing/Generator/UrlGenerator.php

@@ -63,7 +63,7 @@ class UrlGenerator implements UrlGeneratorInterface
      *
      * @throws \InvalidArgumentException When route doesn't exist
      */
-    public function generate($name, array $parameters, $absolute = false)
+    public function generate($name, array $parameters = array(), $absolute = false)
     {
         if (null === $route = $this->routes->get($name)) {
             throw new \InvalidArgumentException(sprintf('Route "%s" does not exist.', $name));

+ 1 - 1
src/Symfony/Component/Routing/Generator/UrlGeneratorInterface.php

@@ -27,5 +27,5 @@ interface UrlGeneratorInterface
      *
      * @return string The generated URL
      */
-    function generate($name, array $parameters, $absolute = false);
+    function generate($name, array $parameters = array(), $absolute = false);
 }