[TYPO3-german] Re: Zugriff auf Flexformwerte aus fluidcontent_core

Jens Schmietendorf jens at smedja.com
Wed Feb 18 11:42:45 CET 2015


Fehler gefunden :-),
habe einfach nur im falschen Feld gesucht -
statt in tt_content.pi_flexform stehen die Daten in tt_content.content_options

<?php
namespace MyNamespace\Mypackage\Controller;


use FluidTYPO3\Flux\Controller\AbstractFluxController;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\DebugUtility;


/**
 * ContentController
 *
 * Controller to render the content element.
 *
 * @package Mypackage
 * @subpackage Controller
 */
class ContentController extends AbstractFluxController {

	/**
	 * @return void
	 */
	protected function initializeViewVariables() {
		$row            = $this->getRecord();
		$flexFormData   = $this->configurationService->convertFlexFormContentToArray( $row['content_options'] );
		// rename key "settings" from fluidcontent_core
		$flexFormData[ 'content' ] = $flexFormData[ 'settings' ];
		unset( $flexFormData['settings'] );
		$this->settings = GeneralUtility::array_merge_recursive_overrule( $this->settings, $flexFormData, false, false );
		#DebugUtility::debug( $this->settings, '$this->settings' );
		parent::initializeViewVariables();
	}

	/**
	 * @return string
	 */

	public function twoColumnAction() {
		#$myVar = array(1 => 'blablupp', 2 => 'blabla');
        #$this->view->assign( 'myVar', $myVar );
	}

}


More information about the TYPO3-german mailing list