1

I am trying to create a bundle in vendors in Symfony2.

MyBundle(MineUserBundle) needs to inherit other two bundle in vendors FOSUserBundle and HWIOAuthBundle.

How to get inherit both bundles properties, templates etc in Mybundle?

vendors
   FOSUserBundle 
   HWIOAuthBundle
   MineUserBundle

Here MineUserBundle needs to have all features of other two bundle.

How to get the process work?

j0k
  • 22,600
  • 28
  • 79
  • 90
Justin John
  • 9,223
  • 14
  • 70
  • 129

1 Answers1

1

Since you are using namespaces it does not mater into which folder you are going to deploy your Bundle. Just include use statements in your bundle with ones you need:

use Path\To\FOS\UserBundle;
use Path\ToHWIO\AuthBundle;

And you can extend whatever you need.

But if you really want to install your bundle to vendor directory, then you have to configure define it in your deps file.

[YourVendorYouBundle]
    git=git@github.com:yourRepository/YourVendorYouBundle.git
    target=/bundles/YourVendor/YouBundle
Vitalii Zurian
  • 17,858
  • 4
  • 64
  • 81
  • Is it possible to install other two bundles with MyBundle deps. i.e I only use MyBundle in deps or composer file, need to automatically install other two bundles in vendors. Whether it can achieved by any alteration in any file in MyBundle? – Justin John Aug 10 '12 at 06:04
  • No, it is not possible, AFAIK. You have to define your deps manually. Don't know about Composer though – Vitalii Zurian Aug 10 '12 at 06:06
  • In HWIOAuthBundle, the user login response are getting in `UserResponseInterface.php` of HWIOAuthBundle itself. I need response get in MyBundle and add new function in `UserResponseInterface.php` from MyBundle. How do this? – Justin John Aug 10 '12 at 06:17
  • the `deps` file is no longer standard practice in symfony2, you should be using composer instead – JamesHalsall Aug 10 '12 at 07:21
  • @Jaitsu questions is tagged as `Symfony-2.0` – Vitalii Zurian Aug 10 '12 at 07:29
  • @thecatontheflat AFAIK symfony2.1 questions aren't tagged separately, although they probably should be given the differences – JamesHalsall Aug 10 '12 at 08:16