开发者

zend form headscript

开发者 https://www.devze.com 2023-04-04 12:04 出处:网络
I have a Zend_Form which I reuse in different controllers. This form 开发者_如何转开发requires a javascript file.

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

精彩评论

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