私はsymfony2.8を使用しています。 私は別のコントローラからコントローラにジャンプしたいと思います。どのように可能ですか?コントローラの中から別のコントローラにjumpt symfony2
これは
DefaultController.php
class DefaultController extends Controller
public function myFirstAction(){
// do something
if ($a = 1){
$this->mySecondAction() // error
}
else {
return $this->render('AcmeMemberBundle:Default:myFirst.html.twig',array());
}
}
public function mySecondAction(){
//do something
return $this->render('AcmeMemberBundle:Default:mySecond.html.twig',array());
}
ます$ this-> mySecondAction以下の私のソースコード(ある)はsymfonyのすべてのアクションが要求インスタンスを渡され
Catchable Fatal Error: Argument 1 passed to Acme\MemberBundle\Controller\DefaultController::secondAction() must be an instance of Symfony\Component\HttpFoundation\Request, none given, called in
ありがとうございました。それは単に私の問題を解決します。 – whitebear