在Laravel 3中,我曾经这样做过.
<?php render('partials.header'); ?>
这是在"PHP"视图中完成的,没有使用Laravel的Blade模板.
版本4中的等价物是什么?
我试过了
<?php @include('partials.header'); ?>
这不起作用.
如果我做
@include('partials.header')
我必须将我的文件保存为".blade.php"
如何在不使用刀片模板的情况下包含"子视图"?
我正在使用laravel 4.2
die(View::make('amendments.changesPopUp', $this->data));
这是我用来获取ajax呼叫视图的代码.这适用于在Windows上运行的本地计算机,但这不适用于服务器(unix).知道为什么这是hapening?
是的,我检查了小写和大写,文件名匹配的情况.而奇怪的是错误指向controller它正在使用的第0行.
这是我得到的错误
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Method Illuminate\\View\\View::__toString() must not throw an exception","file":"mysite.com/app/controllers/myController.php","line":0}}
更新:这在我使用简单的php文件而不是刀片模板时起作用.我还是不知道导致错误的原因是什么?
我正在使用larval 4.2,我在wrapper.php我的视图文件中收到以下错误:
   <?php echo View::make('layouts/blocks/header')->with('sidebar', $sidebar)->with('active', $active); ?>
   <?php echo $content; ?>
   <?php echo View::make('layouts/blocks/footer'); ?>
错误:
   Error : Method Illuminate\View\View::__toString() must not throw an exception
你知道什么导致了这个吗?