如何在我的项目中使用 Zend Framework 2 类? [英] How to use Zend Framework 2 class in my project?

查看:26
本文介绍了如何在我的项目中使用 Zend Framework 2 类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想有可能使用这个库的类,但 2 小时后不可能:

I juste want to have the possibility to use the class of this library but after 2 hours impossible :

那么如何使用 Zend Framework 2.1 和他的自动加载器来只使用这个库的类而不创建 ZF 项目?

So how to use the Zend Framework 2.1 with his autoloader to just use class of this library and not create a ZF project?

我已经用 classmap_generator、inlude_path 尝试了所有东西...我没有任何错误,但它仍然返回给我:

I have try everything with the classmap_generator, inlude_path... i haven't any error but it still return me :

找不到动作类?找不到版本类!

Could not find action class? Could not find version class!

谢谢.

推荐答案

您可以通过 Composer 安装单独的 Zend Framework 模块,这将为您处理大部分:

You can install individual Zend Framework modules via composer, which will take care of most of this for you:

composer.json

composer.json

{
    "require": {
        "zendframework/zend-http": "2.*"
    },  
    "repositories": [
        {   
            "type": "composer",
            "url": "http://packages.zendframework.com/"
        }   
    ],  
    "minimum-stability": "dev"
}

这应该会为您处理任何自动加载.Composer 将生成一个自动加载器,您只需将其包含在您的应用中:

this should take care of any autlloading for you. Composer would generate an autoloader which you would just include in your app:

require 'vendor/autoload.php';

那里有大量的作曲家示例:

there's a load of composer examples out there:

https://packages.zendframework.com/#composer

http://net.tutsplus.com/tutorials/php/easy-package-management-with-composer/

这篇关于如何在我的项目中使用 Zend Framework 2 类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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