You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public function services(){
$data=array(
'title'=>'Our Services',
'services'=>['Web Design','Programming','SEO']
);
return view('pages.services')->with($data);
Didn’t work for me on Laravel 5.8 If I use it in services page like this: @section('content')
But using associative array alone without the regular array like this worked
$data=array(
'title'=>'Our Services',
);
return view('pages.services')->with($data);
so, I had to comment this part out like this @section('content')
This is the error message I get if I don’t comment those sections out
syntax error, unexpected ''services'' (T_CONSTANT_ENCAPSED_STRING), expecting ')'
The text was updated successfully, but these errors were encountered:
public function services(){
$data=array(
'title'=>'Our Services',
'services'=>['Web Design','Programming','SEO']
);
return view('pages.services')->with($data);
Didn’t work for me on Laravel 5.8 If I use it in services page like this:
@section('content')
{{$title}}
@if (count($services) > 0)
@foreach ($services as $service)
@Endforeach
@endsection()
But using associative array alone without the regular array like this worked
$data=array(
'title'=>'Our Services',
);
return view('pages.services')->with($data);
so, I had to comment this part out like this
@section('content')
{{$title}}
{{--@if (count($services)>0)
@foreach ($services as $service)
@Endforeach
@endsection()
And controller like this:
public function services(){
$data = array(
'title' => 'Services'
// 'services' => ['Web Design', 'Programming', 'Software Repairs']
);
return view('pages.services')->with($data);
}
}
This is the error message I get if I don’t comment those sections out
syntax error, unexpected ''services'' (T_CONSTANT_ENCAPSED_STRING), expecting ')'
The text was updated successfully, but these errors were encountered: