외부 코드를 Composer 기반으로 변경
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
include '../vendor/autoload.php';
|
||||
|
||||
// Create new Plates instance
|
||||
$templates = new League\Plates\Engine('templates');
|
||||
|
||||
// Preassign data to the layout
|
||||
$templates->addData(['company' => 'The Company Name'], 'layout');
|
||||
|
||||
// Render a template
|
||||
echo $templates->render('profile', ['name' => 'Jonathan']);
|
||||
@@ -0,0 +1,12 @@
|
||||
<html>
|
||||
<head>
|
||||
<title><?=$this->e($title)?> | <?=$this->e($company)?></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?=$this->section('content')?>
|
||||
|
||||
<?=$this->section('scripts')?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php $this->layout('layout', ['title' => 'User Profile']) ?>
|
||||
|
||||
<h1>User Profile</h1>
|
||||
<p>Hello, <?=$this->e($name)?>!</p>
|
||||
|
||||
<?php $this->insert('sidebar') ?>
|
||||
|
||||
<?php $this->push('scripts') ?>
|
||||
<script>
|
||||
// Some JavaScript
|
||||
</script>
|
||||
<?php $this->end() ?>
|
||||
@@ -0,0 +1,6 @@
|
||||
<ul>
|
||||
<li><a href="#link">Example sidebar link</a></li>
|
||||
<li><a href="#link">Example sidebar link</a></li>
|
||||
<li><a href="#link">Example sidebar link</a></li>
|
||||
<li><a href="#link">Example sidebar link</a></li>
|
||||
</ul>
|
||||
Reference in New Issue
Block a user