dongsi7067
2017-05-28 21:26
浏览 51
已采纳

Symfony 2 - 非捆绑库集成和位置

I am all about the best practice of symfony 2 and I would like to integrate a php library into the project. Library is a non bundle, a simple php class with some methods.

My question just follows the following, which DOES NOT have an accepted answer. Anyway from what I read here I decided to autoload the class, but have no idea where should I locate the php file.

Maybe src/MyBundle/DependencyInjection/? I really doubt it since library has no dependency of other services I have.

Should I create a directory like src/MyBundle/Services/ or src/MyBundle/Libraries/?

What is the best practice here?

图片转代码服务由CSDN问答提供 功能建议

我是关于symfony 2的最佳实践,我想将php库集成到项目中。 库是一个非bundle,一个带有一些方法的简单php类。</ p>

我的问题就在关注,没有接受的答案。 无论如何,我决定自动加载该类,但不知道我应该在哪里找到php文件。</ p>

也许 src / MyBundle / DependencyInjection / </ code> ? 我真的很怀疑它,因为库不依赖于我的其他服务。</ p>

我应该创建一个像 src / MyBundle / Services / </ code>或 src这样的目录 / MyBundle / Libraries / </ code>?</ p>

这里的最佳做法是什么?</ p> </ div>

1条回答 默认 最新

相关推荐 更多相似问题