MVC और request handling · प्रश्न 4 / 12
एक Extbase controller अपने Fluid template को data कैसे देता है?
2 उत्तर सही हैं। आसान
उत्तर दिखाएँ
उत्तर
- B $this->view->assignMultiple(['conferences' => $conferences, 'title' => $title]);
- D $this->view->assign('conferences', $conferences);
व्याख्या
Template variables view object के माध्यम से assign होते हैं: assign() एक variable सेट करता है, assignMultiple() एक साथ कई। नाम ही template variable बनता है, उदाहरण में {conferences}, जिस पर आप <f:for each="{conferences}" as="conference"> से iterate कर सकते हैं। जो values हर action में चाहिए, उन्हें एक बार initializeView() में assign किया जाता है। इसके विपरीत $this->settings plugin का TypoScript या FlexForm configuration है, न कि controller का data रखने की जगह।