代码不显示laravel 5.6中调查应用中问题的答案字段

时间:2018-04-02 05:08:21

标签: php forms laravel

我已经使用表单类在我的应用程序中添加单选按钮选项答案的问题,但我的表单只显示问题测试框不显示单选按钮或选项复选框,并且都不显示答案文本框。     {{$调查 - >标题}}

{{$survey->description}} Created by: {{$survey->user->name}}

{!! Form::open(array('action'=>array('AnswerController@store',$survey->id)))!!} @forelse($survey->questions as $key=>$question)
Question {{$key+1}} - {{$question->title}}

@if($question->question_type==='text') Answer @elseif($question->question_type==='textarea') Textarea @elseif($question->question_type==='radio') @foreach($question->option_name as $key=>$value)
                  <p style="margin:0px; padding:0px;">
                  <input name="{{$question->id}}[answer]" type="radio" id="{{ $key }}" />
                  <label for="{{$key}}">{{$value}}</label>
                  </p>
                  @endforeach
                  @elseif($question->question_type==='checkbox')
                  @foreach($question->option_name as $key=>$value)
                  <p style="margin:0px; padding:0px;">
                  <input type="checkbox" id="something{{$key}}" name="{{$question->id}}[answer]"/>
                  <label for="something{{$key}}">{{$value}}</label>
                  </p>
                  @endforeach
                  @endif
                  <div class="divider" style="margin:10px 10px;"></div>
                  @empty
        <span class='flow-text center-align'>Nothing to show</span>
      @endforelse
      {{Form::submit('Submit Survey',array('class'=>'btn waves-effect waves-light'))}} 
      {!!Form::close()!!}
      </div>here

0 个答案:

没有答案