我有一條指定路線admin.resources.index
,它列出了resources
表中所有記錄的列表,其格式爲foreach
。列表中的每個記錄都有Edit Resource
按鈕。在Laravel的引導程序模式中編輯記錄
// admin/resources/index.blade.php
@foreach ($resources as $resource)
<button class="btn bg-blue waves-effect res-edit-profile-btn" href="{{ route('admin.resources.index', $resource) }}" data-toggle="modal" data-target="#editModal">Edit Resource</button>
@endforeach
而且在同一個頁面(管理/資源/ index.blade.php),我想從resource
對象與值來填充上editModal
。
發行
問題是editModal
打開與admin/resources/index.blade.php
而只是不是隻editModal內容的所有內容。
這些類型的問題上來時,有問題與html
。缺少關閉元素標籤。但是我已經驗證了這個標記。
爲什麼你要加載相同的父url'{{route('admin.resources.index',$ resource)}}'在模態中再次。它不應該是不同的? –
@FarooqKhan,我想在同一頁面打開模式框。 –
從邏輯上講,它應該加載完整的URL(帶資源),除非你有自定義的條件,根據傳遞給查看的數據 –