admin 发表于 2023-2-16 18:55:15

laravel 传递路由参数的方法

<div id="article_content" class="article_content clearfix">
      <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/kdoc_html_views-1a98987dfd.css">
      <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-6e43165c0a.css">
                <div id="content_views" class="htmledit_views">
                  <p>Route::get('apples/{apple}',function($apple){</p>
<p>    return $apple;</p>
<p>]);</p>
<p></p>
<p></p>
<p>在线输入网址&#xff1a;local.laravel.com/apples/传递内容</p>
<p>多个参数的传递</p>
<pre>Route::get('apples/{apple}/comments/{comment}',function($apple,$comment){
    return $apple.&#34;&#34;.$comment;
});</pre>
<p>在线输入网址&#xff1a;<ahref="http://local.laravel.com/apples/123/comments/788sss">http://local.laravel.com/apples/123/comments/788sss</a></p>
<p></p>
                </div>
      </div>
      <div id="treeSkill"></div>
页: [1]
查看完整版本: laravel 传递路由参数的方法