【发布时间】:2018-04-19 12:36:41
【问题描述】:
在刀片文件下方查找:
@foreach($product1['domains']['domain'] as $product)
<tr role="row">
<td class="sorting_desc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Rendering engine: activate to sort column ascending" aria-sort="descending">1</td>
<td class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1"aria-label="Browser: activate to sort column ascending">
<a href="" style="color:#23b7e5" data-toggle="modal" data-target="#myModal1">
{{$product['domainname']}}
</a>
</td>
<td class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending">
{{$product['regdate']}}
</td>
<td class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending">
{{$product['expirydate']}}
</td>
<td class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">Renew</td>
</tr>
@endforeach
在下面找到路线代码:
Route::get('/mydomains','InvoiceTicketController@set');
控制器代码如下:
class InvoiceTicketController extends Controller
{
public function set(){
$product1=Whmcs::GetClientsDomains([]);
return view('clientlayout.main.mydomains',compact('product1'));
}
}
建议我在 laravel 中传递会话变量以在我的视图文件中显示基于客户端的域。
【问题讨论】:
-
它会抛出任何错误吗?
-
我不明白你到底想要什么
-
我需要将用户 ID 作为会话变量传递。
-
为什么不在刀片视图中简单地使用
Auth::id()
标签: laravel laravel-5 laravel-5.2 laravel-5.3 whmcs