【发布时间】:2020-10-18 03:12:13
【问题描述】:
index.blade.php 正在工作
@extends('layouts.app')
@section('content')
{{ $title }}
@endsection
但是 about 和 service 不能使用相同的代码。 在我的 PageController.php 中
public function index(){
$title = 'welcome hiii';
return view('pages.index')->with('title', $title);
}
public function about(){
$title = 'welcome hiiissssssss';
return view('pages.about')->with('title', $title);
}
public function services(){
$data = array(
'title' => 'services'
);
return view('pages.services')->with($data);
}
【问题讨论】:
-
Welcome to SO ...错误告诉您如何避免错误...您是否完成了他们的建议?
-
你是如何定义路由的。我们可以看看你的路线代码吗?
-
它在哪个页面上为您提供
$title错误? -
尽量在您的问题中明确并提供完整的相关数据以及错误详细信息在哪里?您的路线详情在哪里?