2014-02-19 4 views
1

명명 된 루트 - Laravel 4

Route::get('agendarVehiculo/{idvehiculo}/{idcita}', array('as' => 'agendarVehiculo', 'uses' => '[email protected]')); 
경로보기

를로드 할 때 오류가 컨트롤러를 통해 명명 된 경로와 두 PARAMS를 사용하지만, 수신하기 위해 노력하고있어

보기

<td> 
<a href="{{ route('agendarCitaPaciente', [$paciente->id, $cita->id ] }}" class="btn btn-xs btn-success"> <i class="fa fa-calendar"> Agendar</i></a> 
</td> 

오류

syntax error, unexpected '[' 

어떤 아이디어라도 크게 감사드립니다!

답변

0

에 PHP의 5.4+를 괄호 )을인가 colosing 쓰는 것을 잊었 수 있습니다?

@SumanBogati에 의해 지적
<td> 
    <a href="{{ route('agendarCitaPaciente', array($paciente->id, $cita->id)) }}" class="btn btn-xs btn-success"> 
     <i class="fa fa-calendar"> Agendar</i> 
    </a> 
</td> 

, 당신은 또한 누락 된 괄호을 가지고하지 않으면, 당신은해야합니다.

0

보십시오 당신이 배열을 정의하는 새로운 방법을 지원하지 않는 PHP 버전을 사용하고있는 것 같습니다

[$paciente->id, $cita->id ]

array($paciente->id, $cita->id)

로 변경.

0

는이

<a href="{{ route('agendarCitaPaciente', [$paciente->id, $cita->id ]) }}" class="btn btn-xs btn-success"> <i class="fa fa-calendar"> Agendar</i></a> 
//--------------------------------------missing parenthesis here----^