zoukankan      html  css  js  c++  java
  • Laravel 静态资源管理

    <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>
     





  • 相关阅读:
    Static了解和复习继承。
    复习篇1.对象和封装
    第一章笔记
    A + B Problem II
    Number Sequence
    Fibonacci Again
    8615 快乐
    8635 气球
    大牛之路II
    8617 阶乘数字和
  • 原文地址:https://www.cnblogs.com/gyfluck/p/9067746.html
Copyright © 2011-2022 走看看