0

I have tried searching for his and unfortunately I haven't got the solution yet. Hope someone could help me with this. I am trying to get the selected input of this select form:

onewayflight.blade.php

{{ Form::label('adult','Adults: ') }} 
           {{ Form::select('adult', ['12+'=>'12+ years',
                                    '1'=>'1','2'=>'2',
                                    '3'=>'3','4'=>'4',
                                    '5'=>'5','6'=>'6',
                                    '7'=>'7','8'=>'8',
                                    '9'=>'9','10'=>'10',
                                    '11'=>'11','12'=>'12',
                                    '13'=>'13','14'=>'14',
                                    '15'=>'15','16'=>'16',
                                    '17'=>'17','18'=>'18',
                                    '19'=>'19','20'=>'20'],'1',array('class'=>'class="btn btn-default dropdown-toggle"')) }} 

This is what I've passed on my controllers:

$a = Input::get('adult');
    return View::make('content.onewayflightresults')->with('adult',$a);

What would I be throwing in for it to be viewed on a blade template?

4

1 に答える 1

1

以下を使用する必要があります。

{{ Form::select('adult', [/* here your array */],$adult,array('class'=>'class="btn btn-default dropdown-toggle"')) }}

3番目のパラメーターでは、選択した要素の値を渡すためです。

編集

表示するだけの場合は、使用する必要があります

{{{ $adult }}}
于 2014-10-03T19:24:11.420 に答える