4

在 laravel 中,你可以这样做:

@section('metadescription')
   description goes here... 
@stop

但这会导致:

 <meta name="description" content=" XXXXXXXXX ">

我不想要那些空间。有没有办法只指定一组在产生时也会被修剪的参数?

4

2 回答 2

12

如果您只是将简单字符串传递给该部分,则可以将字符串作为第二个参数传递给section. 例如:

@section('metadescription', 'Meta Description goes here')
于 2014-04-12T12:57:41.227 回答
6

这解决了我的问题:

@section('metadescription'){{ "Description goes here" }}@stop
于 2014-04-12T06:36:09.493 回答