简体   繁体   English

传递的变量未显示在刀片​​中 - laravel

[英]A passed Variable not shown in a blade - laravel

As I click the link in results2 blade, the incoming variable (which holds 'Test Text') is passed fine, but this value does not display in the dashboard2 blade. 当我单击results2 blade中的链接时,传入变量(包含'Test Text')传递正常,但此值不会显示在dashboard2刀片中。

The link in results2 blade: results2 blade中的链接:

<a href="{{route('dashboard2',['wordsRow'=> $wordsRow->body])}}">{{$wordsRow->body}}</a>

in Dashboard2 view : 在Dashboard2视图中:

@if (isset($wordsRow))
            <header><h3>{{$wordsRow}}</h3></header>
@endif

URL of the Dashboard2 : 仪表板2的URL:

http://localhost/xxxxxxx/dashboard2?wordsRow=Test+text HTTP://本地主机/ XXXXXXX / dashboard2 wordsRow =测试+文本

Any help determining why 'Test Text' is not shown in the dashboard2 view ? 任何帮助确定仪表板2视图中未显示“测试文本”的原因?

I've never seen somewhere, that Laravel passes $_GET variables automatically to a view. 我从未见过某个地方,Laravel会自动将$ _GET变量传递给视图。 So where is the code for passing these variables to the views? 那么将这些变量传递给视图的代码在哪里?

Try 尝试

@if (Request::has('wordsRow'))
            <header><h3>{{Request::get('wordsRow')}}</h3></header>
@endif

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

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