arctushar
1 year ago

Error in @section

Posted 1 year ago by arctushar

if I use code in blade 5.6 as below

@section('ogtype',{{$node->type}})

It show error as below

syntax error, unexpected '<' (View: E:\xampp\htdocs\resources\views\node\detail.blade.php)

and

<?php $__env->startSection('ogtype',<?php echo e($node->type); ?>); ?>

But If I use code as below

@section('ogtype')
{{$node->type}}
@endsection

Its working, why one line not working ?

Please sign in or create an account to participate in this conversation.