[+FEATURE] Extbase (MVC): It is now possible to pass a template format (like html...
authorJochen Rau <j.rau@web.de>
Wed, 26 Aug 2009 22:44:43 +0000 (22:44 +0000)
committerJochen Rau <j.rau@web.de>
Wed, 26 Aug 2009 22:44:43 +0000 (22:44 +0000)
typo3/sysext/extbase/Classes/MVC/Web/RequestBuilder.php

index 8d7e224..98f0c0b 100755 (executable)
@@ -121,8 +121,8 @@ class Tx_Extbase_MVC_Web_RequestBuilder {
                } else {
                        $controllerName = $this->defaultControllerName;
                        $actionName = $this->defaultActionName;
-               }
-
+               }                               
+               
                $request = t3lib_div::makeInstance('Tx_Extbase_MVC_Web_Request');
                $request->setPluginName($this->pluginName);
                $request->setControllerExtensionName($this->extensionName);
@@ -132,6 +132,10 @@ class Tx_Extbase_MVC_Web_RequestBuilder {
                $request->setBaseURI(t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
                $request->setMethod((isset($_SERVER['REQUEST_METHOD'])) ? $_SERVER['REQUEST_METHOD'] : NULL);
 
+               if (is_string($parameters['format']) && (strlen($parameters['format']))) {
+                       $request->setFormat(filter_var($parameters['format'], FILTER_SANITIZE_STRING));
+               }
+               
                foreach ($parameters as $argumentName => $argumentValue) {
                        $request->setArgument($argumentName, $argumentValue);
                }