zoukankan      html  css  js  c++  java
  • Laravel

    1. 模板文件

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>@yield('title')</title>
        <style>
            .header{
                100%;
                min-height:100px;
                background:gold;
            }
            .main{
                100%;
                min-height:400px;   
            }
            .main .sidebar{
                30%;
                height:400px;
                float:left;
                background:yellow;
            }
            .main .content{
                70%;
                height:400px;
                float:left;
                background:green;
            }
            .footer{
                clear:both;
                100%;
                min-height:100px;
                background:blue;
            }
        </style>
    </head>
    <body>
        <div class="header">
            @section('header')
            头部. 
             section可以定义视图变量,也可以在内部进行拓展.(命令定义一个内容区块)
             yield 只是声明定义,不可拓展. ( “显示指定区块” 的内容。)
            @show
        </div>

        <div class="main">
            <div class="sidebar">
                @section('sidebar')
                侧边栏
                @show
            </div>
            <div class="content">
               @yield('content','主要内容区域')
            </div>
        </div>

        <div class="footer">
            @section('footer')
            底部
            @show
        </div>
    </body>
    </html>
     

    2. 要继承的文件

    @extends('layout')

    <!-- 重写头部 -->
    @section('header')
        <!-- 继承之前的 -->
        @parent
        <h1>重写头部</h1>
    @stop

    <!-- 使用 yield.  先定义section  -->
    @section('content')
      content12
    @stop

    @section('title')
      一拳超人
    @stop
  • 相关阅读:
    解决RuntimeError: cuda runtime error (30) : unknown error at /pytorch/aten/src/THC/THCGeneral.cpp:70&NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the late
    查看Ubuntu/Anaconda/cuda/cudnn/Tensorflow/Pytorch版本
    创建新用户
    142. Linked List Cycle II
    网页版Instagram如何发照片
    141. Linked List Cycle
    将博客搬至CSDN
    92. Reverse Linked List II
    Dlib使用过程全记录(一)
    定制new和delete
  • 原文地址:https://www.cnblogs.com/500m/p/12790342.html
Copyright © 2011-2022 走看看