简体   繁体   English

在laravel 5.2中传递会话变量

[英]passing session variable in laravel 5.2

I have the modal where I am processing the data in the modal and then I need to store 1 value and pass it to the next page but then for some reason it is not working. 我在模态中处理模态中的数据,然后我需要存储1值并将其传递给下一页,但是由于某种原因,它不起作用。

My modal code :- I have the variable $doctorName already set 我的模式代码:-我已经设置了变量$doctorName

session(['doctorName' => $doctorName]);

My view file 我的检视档案

<div class="col-sm-12 row2">
    <table width="100%">
        <tr>
            <td>
                <p>Second Opinion from
                    <br /><span id="dr_Name"></span></p>
            </td>
            {{ session('doctorName') }}
            <td align="right">
                <p>INR 3000/-</p>
            </td>
        </tr>
    </table>
</div>

Try {!! session('doctorName') !!} 试试{!! session('doctorName') !!} {!! session('doctorName') !!} instead of {{ session('doctorName') }} {!! session('doctorName') !!}而不是{{ session('doctorName') }}

Do you open new view after modal? 模态后是否打开新视图? Maybe you need: 也许您需要:

return view('someview')->with('doctorName'); 返回view('someview')-> with('doctorName');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM