我想传递多个参数到Laravel 4.我试过下面的代码URL类:Laravel创建多个参数的URL
<li>
<a href="{{ URL::to('questions/', $chapter->id, false); }}">
<span>Chapter {{ $chapter->chapter_num }}: {{ $chapter->name }}</span>
</a>
</li>
这似乎是一个参数工作。我如何传递多个参数?
我想传递多个参数到Laravel 4.我试过下面的代码URL类:Laravel创建多个参数的URL
<li>
<a href="{{ URL::to('questions/', $chapter->id, false); }}">
<span>Chapter {{ $chapter->chapter_num }}: {{ $chapter->name }}</span>
</a>
</li>
这似乎是一个参数工作。我如何传递多个参数?
将参数传递给数组。例如:
array($chapter->id, $parameter2, $parameter3, false)
这也可以帮助:http://laravel.com/api/source-class-Illuminate.Routing.UrlGenerator.html#76-98
根据文档,您可以将多个参数作为数组传递。
这应该工作: URL::to('questions/', array($chapter->id,$other->propr), false)
希望它能帮助!