0
我想使這些套的觀點之一:Zend Framework:如何刪除控制器中呈現的視圖?
- 頭
- 體佩$ ID1
- 腳
OR
- 頭
- 體佩$ id2
- 腳
其設置exsists。
我不喜歡這樣寫道:
try {
$this->render("head");
$this->render("body-$id1");
$this->render("foot");
} catch (Exception $e) {
$this->render("head");
$this->render("body-$id2");
$this->render("foot");
}
,但它會導致head
觀點被渲染兩次,如果身體 - $ ID1不存在。
你有更好的解決方案嗎?
在另一種說法中,我可以在渲染之前檢查body-$id1
的存在嗎?