<link rel="stylesheet" href="{{ asset('bootstrap/css/bootstrap.min.css') }}" />
asset()对应的路径是Public目录下。

方式一:yield()方法在父模板中的使用
父模板:
@yield('content')

子模板:
@section('content')
这里是具体内容
@stop


方法二:section()方法在父模板中的使用
父模板:
@section('content')
父模板中的内容
@show

子模板:
@section('content')
这里是具体内容
@stop
结论:section() 方法可以在父模板中预定义内容。如果子模板也定义内容,则都显示。

子模板中使用父级布局需要继承父级模板,使用extends方法,示例:@extends('common/layouts')

子模板中需要引用其他页面时,使用include方法,示例:@include('common.message')


根据当前页面判断左侧菜单显示样式
<div class="left-group">
<a class="list-group-item {{ Request::getPathInfo()=='/Student/index'?'active':'' }}" href="{{ url('Student/index') }}"> 学生列表 </a>
<a class="list-group-item {{ Request::getPathInfo()=='/Student/create'?'active':'' }}" href="{{ url('Student/create') }}"> 新增学生 </a>
</div>
 





相关文章:

  • 2021-12-31
  • 2021-12-22
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2021-09-18
  • 2021-08-30
  • 2021-11-30
猜你喜欢
  • 2021-11-27
  • 2022-12-23
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-08-04
相关资源
相似解决方案