如何将第三方 Action Helper 添加到 Zend Framework 1.8+ 应用程序? [英] How to add a third-party Action Helper to a Zend Framework 1.8+ application?

查看:19
本文介绍了如何将第三方 Action Helper 添加到 Zend Framework 1.8+ 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了一个第三方操作助手,我想将其添加到我的应用程序中.我该怎么做?

I have downloaded a third party action helper that I would like to add to my application. How can I do this?

推荐答案

使用 Noginn SendFile Action Helper作为参考,放入库目录,目录结构如下:

Using the Noginn SendFile Action Helper as a reference, dropped into the library directory, the directory structure looks like this:

/library
    /Noginn
        /Controller
            /Action
                /Helper
                    /SendFile.php

/application/Bootstrap.php中添加一个init函数并添加类前缀:

In /application/Bootstrap.php add an init function and add the class prefix:

protected function _initActionHelpers()
{
    Zend_Controller_Action_HelperBroker::addPrefix('Noginn_Controller_Action_Helper');
}

然后在您的控制器中,您可以像这样调用操作助手:

Then in your controller, you can call the action helper like this:

$this->_helper->sendFile($options);

这篇关于如何将第三方 Action Helper 添加到 Zend Framework 1.8+ 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆