Symfony 1.4具有多个应用程序和不同的数据库 [英] Symfony 1.4 with multiple apps and different databases

查看:214
本文介绍了Symfony 1.4具有多个应用程序和不同的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个重要的Symfony项目,其中有不同的应用程序。
我想要有不同的数据库,每个应用程序一个。



我发现我可以有多个数据库连接,但是当我创建模式,模型表单和过滤器symfony将所有这些类放入/ lib /文件夹。



有没有办法根据自己的架构为每个应用程序创建模型,表单,过滤器,并将结果类放在像/ apps / myApp / lib这样的东西?



非常感谢...

解决方案

您可以在模式中使用package参数:

 型号:
连接:doctrine
包装:your_package
tableName:模型
列:
...


I have an important Symfony project, in which I have different apps. I'd like to have different databases, one for each apps.

I've find that I can have multiple database connections, but when I create schema, models forms and filters symfony put all these classes into /lib/folder.

Is there a way for create models, forms, filters for each application based on his own schema, and put the resulting classes into somthing like /apps/myApp/lib?

Thankyou very much...

解决方案

You can use the "package" parameter in your schema like so:

Model:
  connection:                           doctrine
  package:                              your_package
  tableName:                            model
  columns:
    ...

这篇关于Symfony 1.4具有多个应用程序和不同的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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