Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Yielding" in laravel without whitespace?

In laravel you can do this:

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

But this results in:

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

I don't want those spaces. Is there a way to specify only a set of parameters that also get trimmed on being yielded?

like image 390
coderama Avatar asked Dec 01 '22 16:12

coderama


2 Answers

If you're only passing simple strings to the section, you can pass the string as a second argument to the section. For example:

@section('metadescription', 'Meta Description goes here')
like image 65
SUB0DH Avatar answered Dec 25 '22 19:12

SUB0DH


This solved my problem:

@section('metadescription'){{ "Description goes here" }}@stop
like image 22
coderama Avatar answered Dec 25 '22 21:12

coderama