Symfony2 - "This-> Forward" Pointing to external folder

155 Views Asked by At

I need to find the way to make a forward to a controller located in an external folder to the driver of the bundle.

I have tried to do it in different ways but none made ​​it to that driver.

$response = $this->forward
('MiBundle/Api/Subfolder/Controller/Test::index');
return $response;

Example:

MyBundle
 -Api
   -Subfolder
     -Controller 
       -TestController.php (Forward Target)
 -Controller
 -Entity
 -Form
 -Resources
 -Security
 -Services
 -Tests

Can anyone give me a hand with this?

Thank you.

1

There are 1 best solutions below

0
On

Try to use the full path, and so here:

$response = $this->forward('AcmeHelloBundle:Hello:fancy', array(
        'name'  => $name,
        'color' => 'green',
    ));

... that is, use the name of the bundle.