zoukankan      html  css  js  c++  java
  • laravel模板使用

    {{ $var }} - 打印内容

    {{ $var or 'default' }} - 打印内容并带一个默认值

    {{{ $var }}} - 打印转义内容

    {{-- Comment --}} - 注释

    @extends('layout') - 继承模板‘layout’

    @if(condition) - if开始

    @else - else不带条件

    @elseif(condition) - else带条件

    @endif - 结束if

    @foreach($list as $key => $val) - foreach使用

    @endforeach - 结束foreach

    @for($i = 0; $i < 10; $i++) - for循环开始

    @endfor - for循环结束

    @while(condition) - while循环开始

    @endwhile - while循环结束

    @unless(condition) - unless开始

    @endunless - unless结束

    include(file) - 包含其他模板

    @include(file, ['var' => $val,...]) - 包含模板并传输新变量

    @each('file',$list,'item') - 把一个模板放在一个集合中

    @each('file',$list,'item','empty')- (暂时不清楚)

    @yield('section') - 说明块内容,用法类似section

    @show - 结束section并展示section内容

    @lang('message') - 从翻译表格中输出内容

    @choice('message', $count) - Outputs message with language pluralization

    @section('name') -  开始section

    @stop - 结束section并不显示内容

    @endsection -结束section(laravel4后不建议使用)

    @append - (扩展section)

    @overwrite - 重写section(之前的section内容全清除)

  • 相关阅读:
    stm32f103 SPI单线TX发数据来驱动LCD
    【转】常见排序算法
    [转]命令行 Subversion 入门
    JLINK V8 Keil MDK4.10 STM32
    字符串表示的大整数相加
    字符串反转
    字符串表示的大整数相乘
    猴子选大王
    [转]Posix-- 互斥锁 条件变量 信号量
    [转]Openwrt的Inittab
  • 原文地址:https://www.cnblogs.com/ccs-mxs/p/7689859.html
Copyright © 2011-2022 走看看