laravel布局模板的使用示例

 Laravel  2020-08-02  admin  1664  2246

布局文件views/wap/layout/layout.blade.php

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link href="/favicon.ico" rel="SHORTCUT ICON">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>@yield('title','code.cent123.com')</title>
    <meta name="keywords" content="@yield('keywords','code.cent123.com')">
    <meta name="description" content="@yield('description','code.cent123.com')">
    <link rel="stylesheet" type="text/css" href="/wap/css/reset.css">
    <link rel="stylesheet" type="text/css" href="/wap/lib/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="/wap/lib/iconfont/iconfont.css">
    <link rel="stylesheet" type="text/css" href="/wap/css/main.css">
    @section('css')
    @show
</head>
<body>
@include('wap.public.header')
@section('content')
@show
<script src="/wap/js/jquery-3.3.1.min.js"></script>
<script src="/wap/lib/layui/layui.js"></script>
<script type="text/javascript">
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });

    //退出登录
    $("#logout").click(function () {
        // 相关逻辑
    });
</script>
@section('js')
@show
</body>
</html>

视图文件views/wap/user/edit.blade.php

@extends('wap.layout.layout')

@section('title', '编辑用户')
@section('keywords', '编辑用户')
@section('description', '编辑用户')

@section('css')
    <link rel="stylesheet" type="text/css" href="/wap/css/user/user.css">
    <link rel="stylesheet" type="text/css" href="/wap/lib/layui/formSelects/formSelects-v4.css" />
    <style type="text/css">
       
    </style>
@endsection

@section('content')
    <div class="user-edit">
        内容区域
    </div>
@endsection

@section('js')
    <script type="text/javascript" src="/wap/lib/layui/formSelects/formSelects-v4.js"></script>
    <script type="text/javascript">
       
    </script>
@endsection

 

如果文章对您有帮助,点击下方的广告,支持一下作者吧!

转载必须注明出处:

laravel布局模板的使用示例 —— code.cent123.com

相关推荐


Systemd Web 管理系统:简化服务管理

# Systemd Web Systemd Web 是一个 Systemd 的 Web UI 管理系统,通过直观的界面和易用的操作,让用户能够轻松地管理 Linux 系统和服务。该项目旨在简化 Systemd 的使用,使得无论是专业的系统管理员还是普通的用户,都能够方便地对系统进行操作。 ## [github地址] (https://github.com/topascend/systemd

laravel 自定义写入日志

laravel 自定义写入日志if(!function_exists(&#39;myLog&#39;)){ /** *生成自定义文件日志内容 *@param$data *@paramstring$title *@parambool$isClear *@returnvoid *@Author:cent123.com */ functionmyLog($data,string$tit

systemctl 使用

Systemd是Linux系统工具,用来启动守护进程,已成为大多数发行版的标准配置。而systemctl是Systemd的主命令,用于管理系统。其实我们大部分服务都有使用systemctl管理,比如MySQL、Nginx等等。常见配置如下:[Unit] #单元描述 Description=GFAPP #在什么服务启动之后再执行本程序 After=mysql.service [Serv

封装 laravel 的公共队列,延迟处理任务

封装 laravel 的公共队列,延迟处理任务&lt;?php /** *ThisfileispartofLunanShopTeam. *http://code.cent123.com/ *@authorhttp://code.cent123.com/view/387 */ namespaceApp\Jobs; useException; useIlluminate\B