• <legend id='P7wBi'><style id='P7wBi'><dir id='P7wBi'><q id='P7wBi'></q></dir></style></legend>

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

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

      2. 如何使用 Laravel 重定向发送数据

        时间:2023-11-01
      3. <small id='1p5WU'></small><noframes id='1p5WU'>

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

            • <tfoot id='1p5WU'></tfoot>
                <tbody id='1p5WU'></tbody>
                <legend id='1p5WU'><style id='1p5WU'><dir id='1p5WU'><q id='1p5WU'></q></dir></style></legend>
                  本文介绍了如何使用 Laravel 重定向发送数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我开发了一个 API 来在页面加载时显示弹出消息.

                  I developed an API to show a pop up message when the page loaded.

                  并非所有页面都使用弹出式 API.例如,如果用户转到 show($id) 页面,则不需要触发弹出式 API.但在某些特殊情况下,我需要触发弹出窗口.

                  Not all the pages use the pop up API. For example, if the user go to the show($id) page, that doesn't required the pop up api to fire. but in some special cases, I need the pop up to be fired.

                  这是我的代码,**此代码只是为了说明我的观点,而不是实际的工作代码**

                  Here is my code, ** this code is just to illustrate my point, not an actual working code**

                  public function store(){
                      validating the input
                  
                      saving them
                  
                      $id = get the id
                  
                      return Redirect::route('clients.show, $id')
                  }
                  

                  在显示功能中我这样做:

                  and in the show function I do this:

                  public function show($id){
                     $client =Client::find($id)
                     return View::make('clients.profife')->with(array(
                     'data' => $client
                  ))
                  

                  我的问题

                  有没有办法让我可以将数据从 store 函数发送到 show 函数 使用 Redirect::route ?然后在 show 函数中,我检查是否这个 show 函数,我检查这个数据是否已经发送了什么,然后我决定是否触发弹出 api 或不是.

                  My question

                  Is there a way so I can send a data from the store function to the show function using Redirect::route ? and then in the show function, I check if this show function, I check if this data has been sent of what and then I decide whether to fire the pop up api or not.

                  }

                  推荐答案

                  In store()

                  return Redirect::route('clients.show, $id')->with( ['data' => $data] );
                  

                  并在 show() 中用

                  Session::get('data');
                  

                  这篇关于如何使用 Laravel 重定向发送数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 Laravel 中获取会话 ID? 下一篇:Laravel 4.2 说我的应用程序正在生产中.我该如何关闭它?

                  相关文章

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

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

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