Skip to content

Instantly share code, notes, and snippets.

@dodyw
Last active May 11, 2016 05:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dodyw/e2e6675b47672339df75 to your computer and use it in GitHub Desktop.
Save dodyw/e2e6675b47672339df75 to your computer and use it in GitHub Desktop.
use blade outside laravel, ref: https://github.com/PhiloNL/Laravel-Blade
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{{ $pageTitle }}}</title>
<!-- Bootstrap -->
<link href="../assets/bootstrap/css/bootstrap.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="../assets/html5shiv.min.js"></script>
<script src="../assets/respond.min.js"></script>
<![endif]-->
</head>
<body>
@section('sidebar')
This is the master sidebar.
@show
@yield('content')
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="../assets/jquery/jquery-1.11.1.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="../assets/bootstrap/js/bootstrap.js"></script>
</body>
</html>
@extends('layouts.master')
@section('sidebar')
<p>This is appended to the master sidebar.</p>
@stop
@section('content')
{{{ $content }}}
@stop
<?php
require 'vendor/autoload.php';
use Philo\Blade\Blade;
// blade
$views = __DIR__ . '/templates';
$cache = __DIR__ . '/../cache/tpladmin';
$blade = new Blade($views, $cache);
$contet = 'tes doang';
print $blade->view()->make('webdirectory', array('pageTitle' => 'Manage Directory', 'content' => $content));
@anovsiradj
Copy link

thanks buat contohnya.

mau tanya:

print $blade->view()->make('webdirectory', array('pageTitle' => 'Manage Directory', 'content' => $content));

kalau boleh tahu webdirectory itu didapatkan dari mana ya?

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