No subject
Mon May 25 06:25:32 CEST 2015
$format = $this->request->getFormat();
$viewObjectName = str_replace('@format', ucfirst($format), $possibleViewName);
if (class_exists($viewObjectName) === FALSE) {
$viewObjectName = str_replace('@format', '', $possibleViewName);
}
if (isset($this->viewFormatToObjectNameMap[$format]) && class_exists($viewObjectName) === FALSE) {
$viewObjectName = $this->viewFormatToObjectNameMap[$format];
}
return class_exists($viewObjectName) ? $viewObjectName : FALSE;
As you can see, everything depends on the $format. So you'd expect format comes from the Content-type header. So let's nail down where format comes from.
RequestBuilder:loadDefaultValues:
if (!empty($configuration['format'])) {
$this->defaultFormat = $configuration['format'];
}
So where does the magical format comes from? After vigorous investigation -> from TypoScript! That's right. Not a trace of determining the format based on the Content-type request header.
Am I missing something?
This is what I have in the controller:
/**
* @var string
*/
protected $viewFormatToObjectNameMap = array(
'json' => 'TYPO3\CMS\Extbase\Mvc\View\JsonView'
);
/**
* A list of IANA media types which are supported by this controller
*
* @var array
*/
protected $supportedMediaTypes = array('application/json', 'text/html');
More information about the Flow
mailing list