0

谁能解释我如何重定向到使用 URL 中的参数的命名路由?

我有以下代码:

    Route::put('{handle}', array(
        'as' => 'section.update',
        'uses' => 'Manneken\\Api\\SectionManager@update'
    ));

    Route::post('{handle}', function()
    {
        if (Input::has('method') && Input::get('method') === 'PUT') {
            Redirect::route('section.update', array(
                'handle' => ''
            ))->withInput();
        }
    });

所以,我有一个使用{handle}URL 中的 PUT 的路由,如果 POST 请求,我想重定向到该路由。我如何{handle}通过?

4

1 回答 1

0

好吧,我想通了,我缺少$handle闭包函数中的参数。

我必须说,很高兴看到乐于助人的 Laravel 社区在工作。这里有很多对我有用的提示和技巧。所有这些答案让我大吃一惊,非常感谢!

于 2013-06-05T22:07:55.697 回答