I have two bundle A and B. A is the parent of B. Bundle 'A' has AController with construct method with 3 arguments which is defined as a service.
Then i have BController in Bundle 'B' which extends Acontroller. I need to call B controller's methods. I have made a service for BController too. But the problem is that it throws an error with missing argument 1 in __construct.
Is there anything i missed out on.
Class AController{
public function __construct(A,B,C)
{
.......
}
}
service for Acontroller
controller_A:
class: A\Bundle\ABundle\Controller\AController
arguments:
- @A
- "%a.config%"
- @form.factory
For bundle B
Class BController extends Acontroller{
.....
}
service for Bcontroller
controller_B:
class: B\Bundle\BBundle\Controller\BController
arguments:
- @B
- "%B.config%"
- @form.factory
This looks like a routing problem. Did you set something like:
/**
* @Route(service="your_bundle.b_controller")
*/
class BController extends Acontroller{
Explanation here: http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/routing.html#controller-as-service
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With