Skip to content

Instantly share code, notes, and snippets.

@emsifa
Last active February 27, 2016 16:20
Show Gist options
  • Save emsifa/678cf668cad9c0626a9d to your computer and use it in GitHub Desktop.
Save emsifa/678cf668cad9c0626a9d to your computer and use it in GitHub Desktop.
Bermain Komponen di Blade
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/slider.css"/>
</head>
<body>
<header>
<h1>Hello from template.blade.php</h1>
</header>
<main>
<div id="slider">
<div class='slide'>slide 1</div>
<div class='slide'>slide 2</div>
<div class='slide'>slide 3</div>
</div>
<p>Lorem ipsum dolor sit amet.</p>
</main>
<footer>
-- footer here --
</footer>
<script src="js/jquery.js"></script>
<script src="js/main.js"></script>
<script>
$(function() {
alert('Hello from homepage');
});
</script>
<script>
$(function() {
$("#slider").initializeSlider();
});
</script>
</body>
</html>
@extends('template')
@section('content')
@include('slider')
<p>Lorem ipsum dolor sit amet.</p>
@stop
@section('scripts')
@parent
<script>
$(function() {
alert('Hello from homepage');
});
</script>
@stop
<div id="slider">
<div class='slide'>slide 1</div>
<div class='slide'>slide 2</div>
<div class='slide'>slide 3</div>
</div>
@section('stylesheets')
@parent
<link rel="stylesheet" href="css/slider.css"/>
@stop
@section('scripts')
@parent
<script src="js/plugin-slider.js"></script>
<script>
$(function() {
$("#slider").initializeSlider();
});
</script>
@stop
<!doctype html>
<html>
<head>
@section('stylesheets')
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/style.css">
@show
</head>
<body>
<header>
<h1>Hello from template.blade.php</h1>
</header>
<main>
@yield('content')
</main>
<footer>
-- footer here --
</footer>
@section('scripts')
<script src="js/jquery.js"></script>
<script src="js/main.js"></script>
@show
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment