Skip to content

Instantly share code, notes, and snippets.

@zmax
Last active August 29, 2015 14:08
Show Gist options
  • Select an option

  • Save zmax/31845fb09a4866cc4528 to your computer and use it in GitHub Desktop.

Select an option

Save zmax/31845fb09a4866cc4528 to your computer and use it in GitHub Desktop.
Nested section (blade template)
@section('css')
<link rel="stylesheet" href="css/field1.css" />
@parent
@stop
@section('js')
<script src="js/field1.js"></script>
@parent
@stop
@section('css')
<link rel="stylesheet" href="css/field2.css" />
@parent
@stop
@section('js')
<script src="js/field2.js"></script>
@parent
@stop
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Nested section testing</title>
<link rel="stylesheet" href="layout.css"/>
@yield('css')
</head>
<body>
@yield('content')
<script src="js/layout.js"></script>
@yield('js')
</body>
</html>
@extends('test.layout')
@section('css')
<link rel="stylesheet" href="css/page.css" />
@parent
@stop
@section('js')
<script src="js/page.js"></script>
@parent
@stop
@section('content')
@include('test.field1')
@include('test.field2')
@show
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Nested section testing</title>
<link rel="stylesheet" href="layout.css"/>
<link rel="stylesheet" href="css/page.css" />
<link rel="stylesheet" href="css/field1.css" />
<link rel="stylesheet" href="css/field2.css" />
</head>
<body>
<script src="js/layout.js"></script>
<script src="js/page.js"></script>
<script src="js/field1.js"></script>
<script src="js/field2.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment