【发布时间】:2011-08-10 00:42:00
【问题描述】:
我正在关注此页面中有关“使用 ViewScript 装饰器的完全自定义”的部分 -> http://devzone.zend.com/article/3450
在我的表单类的 init 方法中我添加了这个
$this->setDecorators(
array(
array(
'ViewScript',
array(
'script' => 'display.phtml'
)
)
)
);
现在在我的表单出现的地方我有这个:
发生错误
应用程序错误
我在这里做错了什么?我真的需要自定义表单的外观,我只想更改表单而不是整个页面的外观。
我试过这个:
$this->setElementDecorators(array(array('ViewScript', array('viewScript'=>'display.phtml'))))
这有效但会影响整个页面的显示(我使用的是 zend 布局)。我只需要将表单的渲染传递给 display.phtml 页面。
注意:有什么地方特别需要我放置display.phtml吗?我把它放在 view\scripts 文件夹中。
【问题讨论】:
标签: php zend-framework zend-form