私は私のコントローラで2つのアクション機能を持っていると私は他のアクション機能Symfonyのコントローラから別の変数に変数を渡しますか?
これは私のコントローラの私の最初の関数であるに変数を渡したい私のコントローラで
public function newUserAction(Request $request)
{ .........
$url = $this->generateUrl('userBundle_new_user_reasonCodeAjaxView',
array('id' => $newUser->getCode(),
'countCode' => $countCode,));
return $this->redirect($url);
この私の第二目的球
public function userCodeAjaxViewAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$pc = $em->getRepository('UserBundle:Code')->find($id);
if($pc != null)
{
return $this->render('UserBundle:userCodeView.html.twig', array(
'pc' => $pc,
));
}
そして、私のTWIFこの
<div class="">
<div class="panel panel-default step3-textarea top-arrow top-arrow">
<div class="panel-body">
<fieldset>
<div>
{{ pc.name|trans }}
{{countCode}}
</div>
</fieldset>
</div>
</div>
</div>
のように見えます210
エラーが発生しましたVariable "countCode" does not exist in...
他のコントローラのコントローラの変数をどのように使用できますか?
またhttp://twig.sensiolabs.org/doc/functions/index.html解決するために作ることができますこの ! –