如何使用Array在Bootstrap中创建下拉列表?

时间:2018-05-18 00:39:44

标签: php laravel bootstrap-4

我正在寻找帮助,在每个州下面填充下拉菜单。 有更多县的州会扰乱行和列的流动。

下面粘贴的代码来自home.blade.php:

<div class="container">
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="row">
            @foreach ($areas as $country)
                <div class="col-md-12">
                    <h3><a href="{{ route('user.area.store', $country) }}">{{ $country->name }}</a></h3>
                    <hr>

                    <div class="row">
                        @foreach ($country->children as $state)
                            <div class="col-md-4">
                                <h4><a href="{{ route('user.area.store', $state) }}">{{ $state->name }}</a></h4>
                                <hr>

                                @foreach ($state->children as $city)
                                    <h5><a href="{{ route('user.area.store', $city) }}">{{ $city->name }}</a></h5>
                                @endforeach
                            </div>
                        @endforeach
                    </div>
                </div>
            @endforeach
        </div>
    </div>
</div>

@endsection

0 个答案:

没有答案