Answers for "how to use controller method in another controller symfony"

PHP
1

symfony call another controller

// OtherController::fancy($name, $color) will be executed
public function myAction($name)
{
    $response = $this->forward(
    	'App\Controller\OtherController::fancy',
    	array(
      		'name'  => $name,
        	'color' => 'green',
    	)
    );
    // ... further modify the response or return it directly
    return $response;
}
Posted by: Guest on March-24-2021

Code answers related to "how to use controller method in another controller symfony"

Browse Popular Code Answers by Language