zoukankan      html  css  js  c++  java
  • blade模板

    之所以单独提出来,是因为,觉得用模板很蛋疼,但又容易忘记~ 嚓~

    • {{ $var }} - Echo content
    • {{ $var or 'default' }} - Echo content with a default value
    • {{{ $var }}} - Echo escaped content
    • {{-- Comment --}} - A Blade comment
    • @extends('layout') - Extends a template with a layout
    • @if(condition) - Starts an if block
    • @else - Starts an else block
    • @elseif(condition) - Start a elseif block
    • @endif - Ends a if block
    • @foreach($list as $key => $val) - Starts a foreach block
    • @endforeach - Ends a foreach block
    • @for($i = 0; $i < 10; $i++) - Starts a for block
    • @endfor - Ends a for block
    • @while(condition) - Starts a while block
    • @endwhile - Ends a while block
    • @unless(condition) - Starts an unless block
    • @endunless - Ends an unless block
    • @include(file) - Includes another template
    • @include(file, ['var' => $val,...]) - Includes a template, passing new variables.
    • @each('file',$list,'item') - Renders a template on a collection
    • @each('file',$list,'item','empty') - Renders a template on a collection or a different template if collection is empty.
    • @yield('section') - Yields content of a section.
    • @show - Ends section and yields its content
    • @lang('message') - Outputs message from translation table
    • @choice('message', $count) - Outputs message with language pluralization
    • @section('name') - Starts a section
    • @stop - Ends section
    • @endsection - Ends section
    • @append - Ends section and appends it to existing of section of same name
    • @overwrite - Ends section, overwriting previous section of same name

    取自:

    http://laravel-recipes.com/recipes/248/knowing-all-the-blade-template-commands  

  • 相关阅读:
    antd vue如何在父组件里打开子组件(子组件是个模态框)?
    webpack知识点整理
    JavaScript中常用的方法汇总,全部整理好了,一定要收藏!
    从地址栏里面获取参数的值
    何为垫片?垫片是一种什么概念在js中?
    async 与 await使用
    纯手撸Promise
    如何使用 Promise?
    Notification 浏览器桌面通知的使用
    学习骨架屏(Skeleton Screens)技术
  • 原文地址:https://www.cnblogs.com/zhongyuan/p/4715348.html
Copyright © 2011-2022 走看看