开发者

Render view from Zend_form

I try it via my Zend_form:


$output .= $this->_view->render('admin/form.phtml'
                , array('id' => $this->getName()
                    , 'action' => $this->getAction()
                    , 'method' => $this->getMethod()
                    , 'enctype' => $this->getEnctype()
                    , 'data' => array('code' => $code
                                    , 'name' => $name
                                    , 'description' => $description)));

but when i <?php echo $this->enctype; ?> in admin/form.phtml i got nothing.

admin/form.phtml is rendered corre开发者_如何学Goctly


Choosing render just displays the output, Zend does not pass your data to the view. But Using view partials, you could achieve that.

From the documentation,

The Partial view helper is used to render a specified template within its own variable scope. The primary use is for reusable template fragments with which you do not need to worry about variable name clashes. Additionally, they allow you to specify partial view scripts from specific modules.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜