<i id='wKjFP'><tr id='wKjFP'><dt id='wKjFP'><q id='wKjFP'><span id='wKjFP'><b id='wKjFP'><form id='wKjFP'><ins id='wKjFP'></ins><ul id='wKjFP'></ul><sub id='wKjFP'></sub></form><legend id='wKjFP'></legend><bdo id='wKjFP'><pre id='wKjFP'><center id='wKjFP'></center></pre></bdo></b><th id='wKjFP'></th></span></q></dt></tr></i><div id='wKjFP'><tfoot id='wKjFP'></tfoot><dl id='wKjFP'><fieldset id='wKjFP'></fieldset></dl></div>
<tfoot id='wKjFP'></tfoot>

      <small id='wKjFP'></small><noframes id='wKjFP'>

      <legend id='wKjFP'><style id='wKjFP'><dir id='wKjFP'><q id='wKjFP'></q></dir></style></legend>
        • <bdo id='wKjFP'></bdo><ul id='wKjFP'></ul>

        如何在 Laravel 中创建一条包罗万象的路线

        时间:2023-10-30

          <tbody id='8rGZj'></tbody>

            • <i id='8rGZj'><tr id='8rGZj'><dt id='8rGZj'><q id='8rGZj'><span id='8rGZj'><b id='8rGZj'><form id='8rGZj'><ins id='8rGZj'></ins><ul id='8rGZj'></ul><sub id='8rGZj'></sub></form><legend id='8rGZj'></legend><bdo id='8rGZj'><pre id='8rGZj'><center id='8rGZj'></center></pre></bdo></b><th id='8rGZj'></th></span></q></dt></tr></i><div id='8rGZj'><tfoot id='8rGZj'></tfoot><dl id='8rGZj'><fieldset id='8rGZj'></fieldset></dl></div>
            • <tfoot id='8rGZj'></tfoot>

              <small id='8rGZj'></small><noframes id='8rGZj'>

                  <bdo id='8rGZj'></bdo><ul id='8rGZj'></ul>
                  <legend id='8rGZj'><style id='8rGZj'><dir id='8rGZj'><q id='8rGZj'></q></dir></style></legend>
                  本文介绍了如何在 Laravel 中创建一条包罗万象的路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我需要一个 laravel routes.php 条目,该条目将捕获网站特定 domain.com/premium-section 的所有流量,以便我可以在访问高级内容之前提示人们成为会员.

                  I need a laravel routes.php entry that will catch all traffic to a specific domain.com/premium-section of the site so that I can prompt people to become members before accessing the premium content.

                  推荐答案

                  1. 在 app/Http/routes.php 中,我创建了一个路由,该路由将捕获 domain.com/premium-section/anywhere/they/try/to/go 中的所有流量,并尝试在 PremiumSectionController 中查找并执行匹配函数
                  2. 但是没有任何匹配的方法,只是一个包罗万象的方法.

                  1. In app/Http/routes.php I create a route that will catch all traffic within domain.com/premium-section/anywhere/they/try/to/go and attempt to find and execute a matching function within PremiumSectionController
                  2. But there aren't any matching methods, just a catch-all.

                  Route::group(['as' => 'premium-section::',
                                'prefix' => 'premium-section',
                                'middleware' => ['web']],
                                function(){
                                   Route::any('', 'PremiumSectionController@premiumContentIndex');
                                   Route::controller('/', 'PremiumSectionController');
                  
                                });
                  

                  .

                      namespace AppHttpControllers;
                  
                      use ...
                  
                      class PremiumSectionController extends Controller{
                  
                          public function premiumContentIndex(){
                             return 'no extra parameters';
                          }
                  
                          //magically gets called by laravel
                          public function missingMethod($parameters = array()){
                              return $parameters;
                          }
                  
                      }
                  

                  这篇关于如何在 Laravel 中创建一条包罗万象的路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Codeigniter Routes 正则表达式 - 在控制器/方法名称中使用破折号 下一篇:Laravel 5路线未定义,而它是?

                  相关文章

                • <small id='r9cVw'></small><noframes id='r9cVw'>

                  1. <legend id='r9cVw'><style id='r9cVw'><dir id='r9cVw'><q id='r9cVw'></q></dir></style></legend>

                    • <bdo id='r9cVw'></bdo><ul id='r9cVw'></ul>
                    1. <i id='r9cVw'><tr id='r9cVw'><dt id='r9cVw'><q id='r9cVw'><span id='r9cVw'><b id='r9cVw'><form id='r9cVw'><ins id='r9cVw'></ins><ul id='r9cVw'></ul><sub id='r9cVw'></sub></form><legend id='r9cVw'></legend><bdo id='r9cVw'><pre id='r9cVw'><center id='r9cVw'></center></pre></bdo></b><th id='r9cVw'></th></span></q></dt></tr></i><div id='r9cVw'><tfoot id='r9cVw'></tfoot><dl id='r9cVw'><fieldset id='r9cVw'></fieldset></dl></div>
                      <tfoot id='r9cVw'></tfoot>