Skip to content

Instantly share code, notes, and snippets.

@smichaelsen
Last active December 16, 2015 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smichaelsen/5416046 to your computer and use it in GitHub Desktop.
Save smichaelsen/5416046 to your computer and use it in GitHub Desktop.
<?php
namespace MyVendor\EventCenter\ViewHelpers\Form;
class TextfieldViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\TextfieldViewHelper {
/**
* Get errors for the property and form name of this view helper
*
* @return \TYPO3\CMS\Extbase\Error\Result
*/
protected function getMappingResultsForProperty() {
$originalRequestMappingResults = $this->controllerContext->getRequest()->getOriginalRequestMappingResults();
if ($this->isObjectAccessorMode()) {
$formObjectName = $this->viewHelperVariableContainer->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper', 'formObjectName');
return $originalRequestMappingResults->forProperty($formObjectName)->forProperty($this->arguments['property']);
} else {
return $originalRequestMappingResults->forProperty($this->arguments['name']);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment