I use version 1.0.1 of this bundle.
In my setup I have a custom base controller, i.e. :
<?php
namespace Acme\CoreBundle\Controller\Base;
use Symfony\Bundle\FrameworkBundle\Controller\Controller as BaseController;
use JMS\DiExtraBundle\Annotation as DI;
/**
* Controller that provides missing methods for the base controller
*/
class Controller extends BaseController
{
/**
* @DI\Inject
*/
protected $translator;
}
If in my children controller I inject a service, everything works as expected :
<?php
namespace Acme\CoreBundle\Controller\Frontend;
use Acme\CoreBundle\Controller\Base\Controller;
class BarController extends Controller
{
/**
* @DI\Inject
*/
protected $request;
public function indexAction()
{
// Works as expected
}
}
If I don't inject any service, I get an error like Method "Acme\CoreBundle\Controller\Base\Controller::indexAction" does not exist
<?php
namespace Acme\CoreBundle\Controller\Frontend;
use Acme\CoreBundle\Controller\Base\Controller;
class FooController extends Controller
{
public function indexAction()
{
// Method "Acme\CoreBundle\Controller\Base\Controller::indexAction" does not exist.
}
}
It looks like it tries to access to the parent controller instead of the children.
Is it an expected behaviour ? How can I fix that ?
I use version 1.0.1 of this bundle.
In my setup I have a custom base controller, i.e. :
If in my children controller I inject a service, everything works as expected :
If I don't inject any service, I get an error like
Method "Acme\CoreBundle\Controller\Base\Controller::indexAction" does not existIt looks like it tries to access to the parent controller instead of the children.
Is it an expected behaviour ? How can I fix that ?