protected function getSubpartArray($templateCode, $markerArray, $address)
    {
        $subpartArray = [];

        if (\is_array($this->conf['templates.'][$this->conf['templateName'] . '.']['subparts.'])) {
            $lcObj = GeneralUtility::makeInstance(ContentObjectRenderer::class); // local cObj
            $templateService = GeneralUtility::makeInstance(MarkerBasedTemplateService::class); // local cObj

            $lcObj->data = $address;

            foreach ($this->conf['templates.'][$this->conf['templateName'] . '.']['subparts.'] as $spName => $spConf) {
                $spName = '###SUBPART_' . strtoupper(substr($spName, 0, -1)) . '###';

                $spTemplate = $templateService->getSubpart($templateCode, $spName);
                $content = $lcObj->stdWrap(
                    $templateService->substituteMarkerArrayCached(
                        $spTemplate,
                        $markerArray
                    ),
                    $spConf
                );

                if (isset($spConf['hasOneOf']) && !$this->hasOneOf($spConf['hasOneOf'], $address)) {
                    $content = '';
                }

                $subpartArray[$spName] = $content;
            }
        }

        return $subpartArray;
    }
protected function getSubpartArray($templateCode, $markerArray, $address)
    {
        $subpartArray = [];

        if (\is_array($this->conf['templates.'][$this->conf['templateName'] . '.']['subparts.'])) {
            $lcObj = GeneralUtility::makeInstance(ContentObjectRenderer::class); // local cObj
            $templateService = GeneralUtility::makeInstance(MarkerBasedTemplateService::class); // local cObj

            $lcObj->data = $address;

            foreach ($this->conf['templates.'][$this->conf['templateName'] . '.']['subparts.'] as $spName => $spConf) {
                $spName = '###SUBPART_' . strtoupper(substr($spName, 0, -1)) . '###';

                $spTemplate = $templateService->getSubpart($templateCode, $spName);
                $content = $lcObj->stdWrap(
                    $templateService->substituteMarkerArrayCached(
                        $spTemplate,
                        $markerArray
                    ),
                    $spConf
                );

                if (isset($spConf['hasOneOf']) && !$this->hasOneOf($spConf['hasOneOf'], $address)) {
                    $content = '';
                }

                $subpartArray[$spName] = $content;
            }
        }

        return $subpartArray;
    }
protected function getSubpartArray ( $ templateCode , $ markerArray , $ address ) { $ subpartArray = [ ] ; if ( \ is_array ( $ this -> conf [ 'templates.' ] [ $ this -> conf [ 'templateName' ] . '.' ] [ 'subparts.' ] ) ) { $ lcObj = GeneralUtility :: makeInstance ( ContentObjectRenderer :: class ) ; // local cObj $ templateService = GeneralUtility :: makeInstance ( MarkerBasedTemplateService :: class ) ; // local cObj $ lcObj -> data = $ address ; foreach ( $ this -> conf [ 'templates.' ] [ $ this -> conf [ 'templateName' ] . '.' ] [ 'subparts.' ] as $ spName => $ spConf ) { $ spName = '###SUBPART_' . strtoupper ( substr ( $ spName , 0 , - 1 ) ) . '###' ; $ spTemplate = $ templateService -> getSubpart ( $ templateCode , $ spName ) ; $ content = $ lcObj -> stdWrap ( $ templateService -> substituteMarkerArrayCached ( $ spTemplate , $ markerArray ) , $ spConf ) ; if ( isset ( $ spConf [ 'hasOneOf' ] ) && ! $ this -> hasOneOf ( $ spConf [ 'hasOneOf' ] , $ address ) ) { $ content = '' ; } $ subpartArray [ $ spName ] = $ content ; } } return $ subpartArray ; }
gets the user defined subparts and returns their content as an array

@param string $templateCode (HTML) template code
@param array $markerArray markers with content
@param array $address a tt_address record
@return array Array of subparts
gets the user defined subparts and returns their content as an array