【发布时间】:2017-12-15 19:17:30
【问题描述】:
这之前一直运行良好,但我刚刚更新了所有的作曲家文件,现在我在使用 Laravel Blade 时遇到了一些问题。 Laravel 版本是5.4.28。
我有这个部分(calculator/leopardgeckos/partials/ogtags.blade.php):
<link rel="canonical" href="https://reptimatecalculator.com" />
<meta property="fb:app_id" content="1795251550755689">
<meta property="og:url" content="https://reptimatecalculator.com" />
<meta property="og:type" content="website" />
<meta property="og:locale" content="en_GB" />
<meta property="og:title" content="ReptiMate - Leopard Gecko & African Fat Tail Gecko Genetics Calculator" />
<meta property="og:description" content="ReptiMate Calculator was built from the ground up to create an accurate genetics calculator for Leopard Geckos & African Fat Tailed Geckos. You'll get a list of outcomes including percentage chance of recessive genes being carried over, a punnet square of genetics and also a percentage table denoting likelihood of certain combos hatching." />
<meta property="og:image" content="{{ url('images/reptimate-og-image.jpg') }}" />
我试图在我的布局文件中这样调用它:
@yield('ogtags', View::make('calculator.leopardgeckos.partials.ogtags'))
因此,如果在其他模板文件的ogtags 部分中没有设置任何内容,则默认为该部分。
然而,它实际上是把它打印到屏幕上:
我不知道是什么导致了我的错误,这已经有一段时间了。有没有其他人遇到过这种情况?
【问题讨论】:
-
他们添加了它,因此传递给 yield 的内容被转义,请更新到最新的 laravel 以接收修复。 github.com/laravel/framework/pull/19884
-
@David 如上所述,我今天更新了,这就是我现在遇到这个问题的原因
-
哦,等一下,也许我需要清除缓存等
-
不,不走运:(
-
您是否尝试过仅使用
view而不是View::make?如果它是视图契约的一个实例,它不应该逃避它。
标签: php laravel laravel-5 laravel-5.4