开发者

zend form headscript

I have a Zend_Form which I reuse in different controllers. This form 开发者_如何转开发requires a javascript file.

How can I add a link to the javascript inside the form object?

From the view helper I can use headScript(), but inside the form?

Thanks.


$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$view = $viewRenderer->getView();
$view->headScript();

anywhere :)

or ever simpler. Zend_Form have method getView()

UPD: one more way :)

$view = Zend_Layout::getMvcInstance()->getView();
$view->headScript();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜