Created
August 10, 2011 16:57
-
-
Save grahamc/1137408 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Controller_Foo extends Controller | |
{ | |
public function get() | |
{ | |
return 'You got me!'; | |
} | |
public function post() | |
{ | |
return 'You posted me!'; | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/lib/controller/sfFrontWebController.class.php | |
+++ b/lib/controller/sfFrontWebController.class.php | |
@@ -38,6 +38,12 @@ class sfFrontWebController extends sfWebController | |
$request = $this->context->getRequest(); | |
$moduleName = $request->getParameter('module'); | |
$actionName = $request->getParameter('action'); | |
+ $method = $request->getMethod(); | |
+ | |
+ $parsedName = $moduleName; | |
+ if ($actionName != 'index') { | |
+ $parsedName .= '_' . $actionName; | |
+ } | |
if (empty($moduleName) || empty($actionName)) | |
{ | |
@@ -45,7 +51,7 @@ class sfFrontWebController extends sfWebController | |
} | |
// make the first request | |
- $this->forward($moduleName, $actionName); | |
+ $this->forward($parsedName, $method); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment