제 첫 부분을 만들고 렌더링하려고합니다. 먼저 "TableRow.html"파일을 만들었습니다. 부분이 렌더링되지 않습니다.
그럼 내가 테스트 목적의 별칭 맵을 만들었습니다. 전체 코드 :<f:layout name="Default" />
This Template is responsible for creating a table of domain objects.
If you modify this template, do not forget to change the overwrite settings
in /Configuration/ExtensionBuilder/settings.yaml:
Resources:
Private:
Templates:
List.html: keep
Otherwise your changes will be overwritten the next time you save the extension in the extension builder
<f:section name="main">
<table class="tx_troubleshooterv3" >
<tr><td>Test</td></tr>
<f:alias
map="{
masterpagez:
{
0: {
infotext: 'This is the main page.',
questions:
{
0: {
question: 'Main Question A1',
pages:
{
infotext: 'Answer A1',
questions:
{
0: {
question: 'Question B1'
pages: {
infotext: 'Answer B1',
questions:
{
0: {
question: 'Question C1',
pages: {
infotext: 'Answer C1',
questions: NULL
}
}
}
}
}
1: {
question: 'Question B2'
pages: {
infotext: 'Answer B2',
questions: NULL
}
}
}
}
},
1: {
question: 'Main Question A2',
pages:
{
infotext: 'Answer A2',
questions:
{
0: {
question: 'Question B2',
pages: {
infotext: 'Answer B2',
questions: NULL
}
}
}
}
}
}
}
}
}"
>
<f:for each="{masterpagez}" as="masterpage">
<f:for each='{masterpage.questions}' as="qquestion">
<f:for each='{qquestion.pages}' as='page'>
<f:render partial="TableRow" arguments="{page: page}"/>
</f:for>
</f:for>
</f:for>
</f:alias>
위에서 볼 수 있듯이 처음 두 질문의 페이지를 부분 파일로 전달하려고합니다.
TableRow.html
<tr><td><strong>{page.infotext}</strong></td></tr>
을하지만 난 단지 출력 "테스트"와 아무것도 얻을 : 그럼 난 그냥 내 부분에서이 페이지의 텍스트를 렌더링하려고합니다. 왜 내 부분이 렌더링되지 않습니까?
예상 출력 :
응답 A1
응답 B2
출력 (HTML 등) :
업데이트 : 방금 "페이지"변수를 디버깅했지만 예상했던 것처럼 2 대신 2 개의 디버그 상자가 표시 되었습니까?! 누군가 이것을 설명 할 수 있습니까? 예상대로