[TYPO3-english] Re: Extbase/Fluid extension: viewhelper to return associative array (T3 6.2.4)

Hagen Gebauer gebauer at mpi-cbg.de
Fri Feb 20 09:40:56 CET 2015


Hi Anja,

thanks a lot for your reply. But somehow it doesn't work although there isn't a parsing error at least :)
calling {returnArray.a} returns an empty string
{namespace:returnArray.a} or {namespace:test.returnArray.a} instead are not being parsed but displayed as is.
(the class is called TestViewHelper that's why I tried to call namespace:test...)

Here is the full class:

class TestViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
	/**
	*
	* @return array
	*/
	public function render() {
		$returnArray = array('a' => 17, 'b' => 42);
		$this->templateVariableContainer->add('returnArray', $returnArray);
		$output = $this->renderChildren();
		$this->templateVariableContainer->remove('returnArray');
		return $output;
	}
}

Cheers,
Hagen.


More information about the TYPO3-english mailing list