Zend Framework: how to remove rendered views in the controller?
Posted
by takpar
on Stack Overflow
See other posts from Stack Overflow
or by takpar
Published on 2010-03-13T17:56:34Z
Indexed on
2010/03/13
18:15 UTC
Read the original article
Hit count: 250
i want to render one of these sets of views:
- head
- body-$id1
- foot
OR
- head
- body-$id2
- foot
which set exsists.
i do it like this:
try {
$this->render("head");
$this->render("body-$id1");
$this->render("foot");
} catch (Exception $e) {
$this->render("head");
$this->render("body-$id2");
$this->render("foot");
}
but it causes the head
view be rendered twice if body-$id1 does not exists.
do you have a better solution?
in another saying, may i check the existance of body-$id1
before rendering it?
© Stack Overflow or respective owner