1. sfFrontWebController.class.php
  2. /** * sfFrontWebController allows you to centralize your entry point in your web * application, but at the same time allow for any module and action combination * to be requested. * * @package symfony * @subpackage controller * @author Fabien Potencier * @author Sean Kerr * @version SVN: $Id: sfFrontWebController.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ */
  3. class sfFrontWebController extends sfWebController
  4. {
  5. /**
  6. * Dispatches a request.
  7. *
  8. * This will determine which module and action to use by request parameters specified by the user.
  9. */
  10. public function dispatch()
  11. {
  12. try
  13. {
  14. // reinitialize filters (needed for unit and functional tests)
  15. sfFilter::$filterCalled = array();
  16. // determine our module and action
  17. $request = $this->context->getRequest();
  18. $moduleName = $request->getParameter('module');
  19. $actionName = $request->getParameter('action');
  20. if (empty($moduleName) || empty($actionName))
  21. {
  22. throw new sfError404Exception(sprintf('Empty module and/or action after parsing the URL "%s" (%s/%s).', $request->getPathInfo(), $moduleName, $actionName));
  23. }
  24. // make the first request
  25. $this->forward($moduleName, $actionName);
  26. }
  27. catch (sfException $e)
  28. {
  29. $e->printStackTrace();
  30. }
  31. catch (Exception $e)
  32. {
  33. sfException::createFromException($e)->printStackTrace();
  34. }
  35. }
  36. }

Debug toolbar