php framework - laravel-admin submit form jump problem
给我你的怀抱
给我你的怀抱 2017-05-16 16:46:52
0
3
1299

Use the laravel-admin framework as the backend, hoping to jump to the specified url after the form is submitted successfully. The code is as follows:

$form->saved(function (Form $form) use($pid2) {
    // 跳转页面
    return redirect('/admin/page/' . $pid2 . '#tab_9');
});

The problem is: the url after the jump becomes '/admin/page/' . $pid2, and the following #tab_9 is deleted, but I need to keep it. How to deal with it?

给我你的怀抱
给我你的怀抱

reply all(3)
我想大声告诉你
$redirect = app('redirect');
return $redirect->away($redirect->getUrlGenerator()->to('/admin/page/' . $pid2) . '#tab_9', 302, []);
给我你的怀抱

The following is the anchor point. It is normal not to be displayed in the URL. You can use document.URL to obtain it in the front-end JS and you can get #tab_9

小葫芦

In the end, I changed the method (using js to read the data in the page and jump to the url). I haven’t tried the above answer, but thank you for your answer.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template