我需要在 if-else 子句中通过 URL 检查“perPage=100”和“perPage=50”。
@if(perPage=100)
<a class="btn btn-default btn-sm ajax-link back-btn" href="invoice-list?perPage=100" type="button" >Back to List</a>
@elseif(perPage=50)
<a class="btn btn-default btn-sm ajax-link back-btn" href="invoice-list?perPage=50" type="button" >Back to List</a>
@else
<a class="btn btn-default btn-sm ajax-link back-btn" href="invoice-list?perPage=10" type="button" >Back to List</a>
@endif Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你只能写这一行,没有任何if:
<a class="btn btn-default btn-sm ajax-link back-btn" href="{{url('invoice-list?perPage=' . $perPage)}}" type="button">Back to List</a>确保您有 $perPage 变量