Laravel Blade - pass variable via an @include or @yield

南笙酒味 提交于 2019-12-05 02:01:58

According to the documentation, the include-way should be the way to do it:

Including Sub-Views

@include('view.name')

You may also pass an array of data to the included view:

@include('view.name', array('some'=>'data'))

My hunch is that $title is conflicting with another variable in your nested templates. Just for troubleshooting, try temporarily calling it something else.

Imtiaz Pabel

pass an array of data to the included view

@include('view.name', array('some'=>'data'))

then use this on view/name folder

{{ $some }}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!