//输出视图

//建立控制器方法
public function hello_test(){
return view('member/hello_test',['name'=>'张三','age'=>18]);
}

//设置路由
Route::get('member/hello_test',['uses'=>'MemberController@hello_test']);

//创建视图文件
再resourses下的views下建立Member目录,建立hello_test.blade.php。

//视图中输出变量
{{$name}} {{$age}}

相关文章:

  • 2022-01-14
  • 2021-11-20
  • 2021-05-24
  • 2021-10-05
  • 2021-12-24
  • 2022-01-10
  • 2022-02-17
  • 2022-12-23
猜你喜欢
  • 2021-07-29
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
相关资源
相似解决方案