i have
class examController{
public function regMail(){
}
}
i want to call regMail() in authController
class authController{
// i want regMail() here
}
i have
class examController{
public function regMail(){
}
}
i want to call regMail() in authController
class authController{
// i want regMail() here
}
To doing that, you have 2 solutions :
1 - Use forwarding (the good practice) ;
//In your controllor
public function indexAction($name) {
$response = $this->forward('AppBundle:Something:fancy', array(
'name' => $name,
'color' => 'green',
));
// ... further modify the response or return it directly
return $response;
}
2 - Define your controller as service (the bad practice) ;
Try to look a this post for more details and (of course) the official documentation. Good luck ^^!