TYPO3 CMS  TYPO3_6-2
ContainerElementView.php
Go to the documentation of this file.
1 <?php
3 
23 
29  protected function renderChildren(array $children, $spaces = 0) {
30  $content = '';
32  foreach ($children as $child) {
33  $content .= $this->renderChild($child, $spaces);
34  }
35  return $content;
36  }
37 
43  protected function renderChild(\TYPO3\CMS\Form\Domain\Model\Element\AbstractElement $modelChild, $spaces) {
44  $content = '';
45  $class = \TYPO3\CMS\Form\Utility\FormUtility::getInstance()->getLastPartOfClassName($modelChild);
46  $className = 'TYPO3\\CMS\\Form\\View\\Mail\\Plain\\Element\\' . ucfirst($class) . 'ElementView';
47  if (class_exists($className)) {
49  $childElement = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($className, $modelChild, $spaces);
50  $elementContent = $childElement->render();
51  if ($elementContent != '') {
52  $content = $childElement->render() . chr(10);
53  }
54  }
55  return $content;
56  }
57 
58 }