我写了一个viewhelper renderChildren()
...我收到了这个错误,这对我来说毫无意义:
模板标签没有正确嵌套。预期:Tx_Hplusinfo_ViewHelpers_RehaKatViewHelper;实际:Tx_hplusinfo_ViewHelpers_RehaKatViewHelper
这是导致此消息的模板部分:
<f:if condition="{demand.pageId}=={settings.sucheRehaPid}">
<h:rehaKat klinik="{entfernung.klinik}" demand="{demand}" as="kat">
<td><f:if condition="{kat.isStationaer}">✓</f:if></td>
<td><f:if condition="{kat.isAmbulant}">✓</f:if></td>
</h:rehaKat>
</f:if>
这是 viewhelper 渲染函数:
/**
*
* @param Tx_Hplusinfo_Domain_Model_Klinik $klinik
* @param Tx_Hplusinfo_Domain_Model_SearchDemand $demand
* @param string $as Iteration variable
* @return string
*/
public function render(Tx_Hplusinfo_Domain_Model_Klinik $klinik, Tx_Hplusinfo_Domain_Model_SearchDemand $demand, $as ) {
$isAmbulant = false;
$isStationaer = false;
foreach($klinik->getReha() as $klinikreha) {
foreach($demand->getRehas() as $demandreha) {
if($klinikreha->getReha()->getUid() == $demandreha) {
if(!$isStationaer)
$isStationaer = $klinikreha->getIsStationaer();
if(!$isAmbulant)
$isAmbulant = $klinikreha->getIsAmbulant();
break;
}
}
if ($isAmbulant && $isStationaer)
break;
}
$this->templateVariableContainer->add($as, array('isAmbulant'=>$isAmbulant, 'isStationaer'=>$isStationaer));
return $this->renderChildren();
}