PHP数组项

这段代码的答案部分中有一个问题,问题部分工作正常,这只是个问题..当dd($ questionnaire)答案数组存在但未显示项目时

@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">{{ $questionnaire->title }}</div>

                <div class="card-body">
                  <a class="btn btn-dark" href="/questionnaires/{{ $questionnaire->id }}/questions/create">Create Question</a>
                  <a class="btn btn-dark" href="/surveys/{{ $questionnaire->id }}-{{ Str::slug($questionnaire->title) }}">Complete Questionnaire</a>
                </div>
            </div>

            @foreach($questionnaire->questions as $question)
              <div class="card mt-3">
                  <div class="card-header">{{ $question->question }}</div>

                  <div class="card-body">
                    <ul class="list-group">
                      @foreach($question->answers as $answer)
                        <li class="list-group-item">{{ $answer->answers }}</li>
                      @endforeach
                    </ul>
                  </div>
              </div>
            @endforeach
        </div>
    </div>
</div>
@endsection
评论
  • 情侣
    情侣 回复

    dd Function means die and debug so your script stops at this point. Nothing else runs after dd