Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Set of blade yield, section, and extend use cases that are handy to remember without having to look up every time :)

Default yield statement


Default Section

	content that will always be present

Single line yield statement

use this for injecting class names, or single line, space sensitive values

@yield('section_name', 'default_value')

Single line section statement

use this with the single line yield statement above

@section('section_name', 'value')

Section with default content

similar to a yield but with default content and allows child overriding

	default content goes in here
	multi lines and all sorts of codez

Append to a parent section instead of replacing it

using the @parent keyword

View 1


View 2

@extends('View 1')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment