2015-01-24 7 views
0

오류 URL 매개 변수 때 폼 젠드 프레임 워크의 요소 (2)

... 
'may_terminate' => true, 
'child_routes' => array(
    'resetpassword' => array(
     'type' => 'Literal', 
     'options' => array(
     'route' => '/reset-password', 
     'defaults' => array(
      'controller' => 'User\Controller\Index', 
      'action' => 'resetpassword', 
     ), 
     ), 
    ), 
) 
... 

module.config.php에서 내가 $form->setAttribute('action', $this->url('user/resetpassword'));가 정상 설정하면

<?php 
    $user_id = 1; 
    $token = 'ABCXYZ' 
    $form = $this->form; 
    $form->prepare(); 
    $form->setAttribute('action', $this->url('user/resetpassword?user_id='.$user_id.'&token='.$token)); 
    $form->setAttribute('id', 'reset-password-form'); 
?> 

로 .phtml 암호를 재설정 형성하지만, 저장 설정 PARAMS가 함께 USER_ID 때 토큰 => 오류 해결 방법?

답변

1

URL보기 도우미의 첫 번째 인수가 경로 이름이기 때문에. 당신이 어떤 검색어 매개 변수를 추가하려는 경우, 당신은 세 번째 인수를 사용할 수 있습니다 ($options-see documentation)

예 :

$url = $this->url('user/resetpassword', [], ['query' => ['user_id' => $user_id]]);