zoukankan      html  css  js  c++  java
  • laravel基于Bootstrap的成功和失败的提示信息和验证提示信息

    message.blade.php

    <!-- 成功提示框 -->
    @if(Session::has("success"))
        <div class="alert alert-success alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">×</span>
            </button>
            <strong>成功!</strong> {{Session::get('success')}}
        </div>
    @endif
    <!-- 失败提示框 -->
    @if(Session::has("error"))
        <div class="alert alert-danger alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">×</span>
            </button>
            <strong>失败!</strong> {{Session::get('error')}}
        </div>
    @endif
    

      

    validattor.blade.php

    <!-- 所有的错误提示 -->
    @if(count($errors))
        <!--展示第一条错误信息-->
        <div class="alert alert-danger">
            <ul>
                <li>{{$errors->first()}}</li>
            </ul>
        </div>
        <!--遍历所有的错误信息-->
        <div class="alert alert-danger">
            <ul>
                @foreach($errors->all() as $error)
                    <li>{{$error}}</li>
                @endforeach
            </ul>
        </div>
    @endif
    

      

    validation错误提示:

    @if(count($errors)>0)
                    <div class="alert alert-danger" role="alert">
                        @foreach($errors->all() as $error)
                            <li>{{$error}}</li>
                        @endforeach
                    </div>
                @endif
    

      

  • 相关阅读:
    康师傅JVM:运行时数据区概述及线程(三)
    康师傅JVM:程序计数器(四)
    Git常用命令
    Arthas概述
    康师傅JVM:JVM与Java体系结构(一)
    LabVIEW 连接MySQL数据库
    LabVIEW dll 崩溃
    LabVIEW 关于定时的研究
    NI 配置管理软件MAX的一些功能使用介绍
    LabVIEW 串口通信
  • 原文地址:https://www.cnblogs.com/yiweiyihang/p/8486244.html
Copyright © 2011-2022 走看看