/src/Vendor/JobQueueBundle/Controller/DefaultController.php
namespace Vendor\JobQueueBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use JMS\JobQueueBundle\Controller\JobController;
/**
* @Route("/jobs")
*/
class DefaultController extends JobController
{
/**
* @Route("/index")
*/
public function indexAction()
{
die();
}
}
/app/config/routing.yml
vendor_api_job_queue:
resource: "@VendorJobQueueBundle/Controller/"
type: annotation
prefix: /
JMSJobQueueBundle:
resource: "@JMSJobQueueBundle/Controller/"
type: annotation
/src/Syntetik/API/JobQueueBundle/SyntetikAPIJobQueueBundle.php
namespace Vendor\JobQueueBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class VendorJobQueueBundle extends Bundle
{
public function getParent()
{
return 'JMSJobQueueBundle';
}
}
当我尝试调用 /jobs/index 时,我得到:
Method "JMS\JobQueueBundle\Controller\JobController::indexAction" does not exist.
DefaultController 被完全忽略,不知道为什么?
谢谢!