0

Here is my Controller code:

 public function method(Request $request){
   $typeType = $request->type; //this variable show 'Booking'

   return view('home.profile',compact('type'));
 }

Here is blade file :

 @extends('layouts.dashboard')
 @section('page_heading',{{$taskType}})
 @section('section')
    //here some code
 @stop

if I use this blade code. then I have got this problem:

Parse error: syntax error, unexpected '<' (View:resources/view/home/profile.blade.php)

if I use this code on blade

 @extends('layouts.dashboard')
 @section('page_heading','{{$taskType}}')
 @section('section')
    //here some code
 @stop

then blade file display it:

<?php echo e($taskType); ?>

I want to display it on blade file:

 Booking

How can I solve this problem?

2
  • You named the variable $task, not $taskType Commented Jun 1, 2018 at 5:21
  • yes, I'm changing but also show error. Commented Jun 1, 2018 at 5:43

2 Answers 2

2

Probably you don't need {{ }} inside a Blade Directive.

So change that to:

 @section('page_heading', $taskType)
Sign up to request clarification or add additional context in comments.

1 Comment

If it was your answer, please mark it as best answer
0
public function method(Request $request){
   $typeType = $request->type; //this variable show 'Booking'

   return view('home.profile')->with(['taskType' => $typeType]);
 }

1 Comment

Can you please go ahead and let me know by printing what error are you getting? I mean print_r($typeType) in controller and refresh the page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.