search

Home  >  Q&A  >  body text

php framework - laravel-admin submit form jump problem

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?

给我你的怀抱给我你的怀抱2806 days ago1287

reply all(3)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-05-16 16:48:52

    $redirect = app('redirect');
    return $redirect->away($redirect->getUrlGenerator()->to('/admin/page/' . $pid2) . '#tab_9', 302, []);

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-16 16:48:52

    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

    reply
    0
  • 高洛峰

    高洛峰2017-05-16 16:48:52

    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.

    reply
    0
  • Cancelreply