Configure html files with twig
This commit is contained in:
parent
e7b5eec29d
commit
424737117a
@ -7,14 +7,14 @@ class Home
|
|||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
echo "This is index of home"; // Nanti di replace sama twig view ke App\Views\Data\pengumuman.html
|
// echo "This is index of home"; // Nanti di replace sama twig view ke App\Views\Data\pengumuman.html
|
||||||
View::render('Data/pengumuman.html');
|
View::render('Data/pengumuman.html');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function login()
|
public function login()
|
||||||
{
|
{
|
||||||
echo "You have to login"; // Nanti di replace sama twig view ke App\Views\Access\login.html
|
// echo "You have to login"; // Nanti di replace sama twig view ke App\Views\Access\login.html
|
||||||
View::render('Access/login.html');
|
View::render('Access/login.html');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -7,14 +7,14 @@ class Posts
|
|||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
echo "This is index of posts."; // Nanti di replace sama twig view ke App\Views\Data\pengumuman.html
|
// echo "This is index of posts."; // Nanti di replace sama twig view ke App\Views\Data\pengumuman.html
|
||||||
View::render('Data/pengumuman.html');
|
View::render('Data/pengumuman.html');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function entry()
|
public function entry()
|
||||||
{
|
{
|
||||||
echo "You can entry new data here."; // Nanti di replace sama twig view ke App\Views\Data\entry_pengumuman.html
|
// echo "You can entry new data here."; // Nanti di replace sama twig view ke App\Views\Data\entry_pengumuman.html
|
||||||
View::render('Data/entry_pengumuman.html');
|
View::render('Data/entry_pengumuman.html');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ class Posts
|
|||||||
public function edit($id = null)
|
public function edit($id = null)
|
||||||
{
|
{
|
||||||
if ($id) {
|
if ($id) {
|
||||||
echo "You can edit exists data with id $id here"; // Nanti di replace sama twig view ke App\Views\Data\edit_pengumuman.html
|
// echo "You can edit exists data with id $id here"; // Nanti di replace sama twig view ke App\Views\Data\edit_pengumuman.html
|
||||||
View::render('Data/edit_pengumuman.html');
|
View::render('Data/edit_pengumuman.html');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
<input type="hidden" name="_method" value="post">
|
<input type="hidden" name="_method" value="post">
|
||||||
|
|
||||||
<!-- Token -->
|
<!-- Token -->
|
||||||
<input type="hidden" name="_token_" value="##TOKEN##">
|
<input type="hidden" name="_token" value="##TOKEN##">
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
@ -1,58 +1,55 @@
|
|||||||
<!DOCTYPE html>
|
{% extends "base.html" %}
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Edit Pengumuman</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<form method="post">
|
|
||||||
<h3>Pengumuman 1</h3>
|
|
||||||
|
|
||||||
<label for="kategori">Kategori: </label>
|
{% block title %}Edit Pengumuman{% endblock %}
|
||||||
<select name="kategori">
|
|
||||||
<option value="kategori_1">Kategori 1</option>
|
|
||||||
<option value="kategori_2">Kategori 2</option>
|
|
||||||
<option value="kategori_3">Kategori 3</option>
|
|
||||||
<option value="kategori_4">Kategori 4</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<br>
|
{% block body %}
|
||||||
|
<form method="post">
|
||||||
|
<h3>Pengumuman 1</h3>
|
||||||
|
|
||||||
<label for="konten">Konten: </label>
|
<label for="kategori">Kategori: </label>
|
||||||
<textarea name="konten" rows="3" cols="30"></textarea>
|
<select name="kategori">
|
||||||
|
<option value="kategori_1">Kategori 1</option>
|
||||||
|
<option value="kategori_2">Kategori 2</option>
|
||||||
|
<option value="kategori_3">Kategori 3</option>
|
||||||
|
<option value="kategori_4">Kategori 4</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<label for="first-approach">Dibuat pada: </label>
|
<label for="konten">Konten: </label>
|
||||||
<input type="text" name="first-approach" value="2017-08-28 15:20">
|
<textarea name="konten" rows="3" cols="30"></textarea>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<label for="first-touch">Dibuat oleh: </label>
|
<label for="first-approach">Dibuat pada: </label>
|
||||||
<input type="text" name="first-touch" value="User 1">
|
<input type="text" name="first-approach" value="2017-08-28 15:20">
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<label for="edit">Diubah pada: </label>
|
<label for="first-touch">Dibuat oleh: </label>
|
||||||
<input type="text" name="edit" value="2017-08-28 15:34">
|
<input type="text" name="first-touch" value="User 1">
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<label for="editor">Diubah oleh: </label>
|
<label for="edit">Diubah pada: </label>
|
||||||
<input type="text" name="editor" value="User 2">
|
<input type="text" name="edit" value="2017-08-28 15:34">
|
||||||
|
|
||||||
<!-- Current Timestamp -->
|
<br>
|
||||||
<input type="hidden" name="_currts" value="##CURRENT_TIMESTAMP##">
|
|
||||||
|
|
||||||
<!-- Method -->
|
<label for="editor">Diubah oleh: </label>
|
||||||
<input type="hidden" name="_method" value="put">
|
<input type="text" name="editor" value="User 2">
|
||||||
|
|
||||||
<!-- Token -->
|
<!-- Current Timestamp -->
|
||||||
<input type="hidden" name="_token" value="##TOKEN##">
|
<input type="hidden" name="_currts" value="##CURRENT_TIMESTAMP##">
|
||||||
|
|
||||||
<br>
|
<!-- Method -->
|
||||||
|
<input type="hidden" name="_method" value="put">
|
||||||
|
|
||||||
<button type="submit" name="edit">Edit</button>
|
<!-- Token -->
|
||||||
</form>
|
<input type="hidden" name="_token" value="##TOKEN##">
|
||||||
</body>
|
|
||||||
</html>
|
<br>
|
||||||
|
|
||||||
|
<button type="submit" name="edit">Edit</button>
|
||||||
|
</form>
|
||||||
|
{% endblock %}
|
||||||
|
@ -1,36 +1,33 @@
|
|||||||
<!DOCTYPE html>
|
{% extends "base.html" %}
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Tambah Pengumuman</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<form method="post">
|
|
||||||
<h3>Tambah Pengumuman</h3>
|
|
||||||
|
|
||||||
<label for="kategori">Kategori</label>
|
{% block title %}Tambah Pengumuman{% endblock %}
|
||||||
<select name="kategori">
|
|
||||||
<option value="kategori_1">Kategori 1</option>
|
|
||||||
<option value="kategori_2">Kategori 2</option>
|
|
||||||
<option value="kategori_3">Kategori 3</option>
|
|
||||||
<option value="kategori_4">Kategori 4</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<br>
|
{% block body %}
|
||||||
|
<form method="post">
|
||||||
|
<h3>Tambah Pengumuman</h3>
|
||||||
|
|
||||||
<label for="konten">Konten</label>
|
<label for="kategori">Kategori</label>
|
||||||
<textarea name="konten" rows="3" cols="30"></textarea>
|
<select name="kategori">
|
||||||
|
<option value="kategori_1">Kategori 1</option>
|
||||||
|
<option value="kategori_2">Kategori 2</option>
|
||||||
|
<option value="kategori_3">Kategori 3</option>
|
||||||
|
<option value="kategori_4">Kategori 4</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- Current Timestamp -->
|
<br>
|
||||||
<input type="hidden" name="_currts" value="##CURRENT_TIMESTAMP##">
|
|
||||||
|
|
||||||
<!-- Method -->
|
<label for="konten">Konten</label>
|
||||||
<input type="hidden" name="_method" value="post">
|
<textarea name="konten" rows="3" cols="30"></textarea>
|
||||||
|
|
||||||
<!-- Token -->
|
<!-- Current Timestamp -->
|
||||||
<input type="hidden" name="_token" value="##TOKEN##">
|
<input type="hidden" name="_currts" value="##CURRENT_TIMESTAMP##">
|
||||||
|
|
||||||
<button type="submit" name="entry">Entry</button>
|
<!-- Method -->
|
||||||
</form>
|
<input type="hidden" name="_method" value="post">
|
||||||
</body>
|
|
||||||
</html>
|
<!-- Token -->
|
||||||
|
<input type="hidden" name="_token" value="##TOKEN##">
|
||||||
|
|
||||||
|
<button type="submit" name="entry">Entry</button>
|
||||||
|
</form>
|
||||||
|
{% endblock %}
|
||||||
|
@ -1,22 +1,21 @@
|
|||||||
<!DOCTYPE html>
|
{% extends "base.html" %}
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Pengumuman</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h2>List Pengumuman</h2>
|
|
||||||
|
|
||||||
<h3><a href="#">Pengumuman 1</a></h3>
|
{% block title %}Pengumuman{% endblock %}
|
||||||
<code><a href="#">Edit</a></code>
|
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
||||||
|
|
||||||
<h3><a href="#">Pengumuman 1</a></h3>
|
{% block body %}
|
||||||
<code><a href="#">Edit</a></code>
|
<h2>List Pengumuman</h2>
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
||||||
|
|
||||||
<h3><a href="#">Pengumuman 1</a></h3>
|
<h3>Pengumuman 1</h3>
|
||||||
<code><a href="#">Edit</a></code>
|
<code><a href="./posts/edit/1">Edit</a></code>
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
||||||
</body>
|
|
||||||
</html>
|
<h3>Pengumuman 1</h3>
|
||||||
|
<code><a href="./posts/edit/2">Edit</a></code>
|
||||||
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
||||||
|
|
||||||
|
<h3>Pengumuman 1</h3>
|
||||||
|
<code><a href="./posts/edit/3">Edit</a></code>
|
||||||
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
||||||
|
|
||||||
|
<a href="./posts/entry">+ Tambah Pengumuman</a>
|
||||||
|
{% endblock %}
|
||||||
|
12
App/Views/base.html
Normal file
12
App/Views/base.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>{% block title %}{% endblock %}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<a href="/">Home</a>
|
||||||
|
{% block body %}
|
||||||
|
{% endblock %}
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user