Skip to content

Instantly share code, notes, and snippets.

@grahamc
Created August 10, 2011 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamc/1137408 to your computer and use it in GitHub Desktop.
Save grahamc/1137408 to your computer and use it in GitHub Desktop.
<?php
class Controller_Foo extends Controller
{
public function get()
{
return 'You got me!';
}
public function post()
{
return 'You posted me!';
}
}
?>
--- 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