且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Laravel 4 Blade @include变量

更新时间:2023-02-26 07:42:59

为什么要将它从包含传递给调用模板?如果在调用模板中需要它,请在其中创建它,然后将其传递到包含的模板中,如下所示:

Why would you pass it from the include to the calling template? If you need it in the calling template, create it there, then pass it into the included template like this:

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

http://laravel.com/docs/templates 上的代码段

Above code snippet from http://laravel.com/docs/templates