Browse Source

[FrameworkBundle] made a small optimization

Fabien Potencier 15 năm trước cách đây
mục cha
commit
9e157f51a3

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameConverter.php

@@ -56,7 +56,7 @@ class ControllerNameConverter
 
         list($class, $method) = $parts;
 
-        if (!preg_match('/Action$/', $method)) {
+        if ('Action' != substr($method, -6)) {
             throw new \InvalidArgumentException(sprintf('The "%s::%s" method does not look like a controller action (it does not end with Action)', $class, $method));
         }
         $action = substr($method, 0, -6);