php - How to pass value from view to modal? -
i have link open modal:
<li><a href="#deleteproperty{{$property->id}}" data-toggle="modal"><i class="fa fa-times"></i></a></li>
and have modal in seperate page modals.blade.php
<div class="modal fade modal_form" id="deleteproperty{{$property->id}}" tabindex="-1" role="dialog" aria-labelledby="examplemodallabel5" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="close"> <span aria-hidden="true">×</span> </button> <h4 class="modal-title" id="examplemodallabel5">are sure want delete property?</h4> </div> <div class="modal-body"> <form method="post" action="{{ route('user.property.delete',[$user->id,$property->id])}}"> <div class="form-group"> <div class="left-btn"> <button type="button" class="btn btn-primary" data-dismiss="modal">no</button> </div> <div class="right-btn"> <button type="submit" class="btn btn-primary">yes</button> </div> </div> </form> </div> </div> </div> </div>
how can pass parameter ($property->id) modal when user click on specific property, delete property?
you need pass variables want use in included views.
example:
@include('standarduser.includes.modals', [ "property" => $property ])
Comments
Post a Comment