Configure html files with twig
This commit is contained in:
parent
e7b5eec29d
commit
424737117a
@ -7,14 +7,14 @@ class Home
|
||||
{
|
||||
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');
|
||||
return true;
|
||||
}
|
||||
|
||||
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');
|
||||
return true;
|
||||
}
|
||||
|
@ -7,14 +7,14 @@ class Posts
|
||||
{
|
||||
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');
|
||||
return true;
|
||||
}
|
||||
|
||||
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');
|
||||
return true;
|
||||
}
|
||||
@ -22,7 +22,7 @@ class Posts
|
||||
public function edit($id = null)
|
||||
{
|
||||
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');
|
||||
return true;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
<input type="hidden" name="_method" value="post">
|
||||
|
||||
<!-- Token -->
|
||||
<input type="hidden" name="_token_" value="##TOKEN##">
|
||||
<input type="hidden" name="_token" value="##TOKEN##">
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -1,10 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Edit Pengumuman</title>
|
||||
</head>
|
||||
<body>
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Edit Pengumuman{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form method="post">
|
||||
<h3>Pengumuman 1</h3>
|
||||
|
||||
@ -54,5 +52,4 @@
|
||||
|
||||
<button type="submit" name="edit">Edit</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
|
@ -1,10 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Tambah Pengumuman</title>
|
||||
</head>
|
||||
<body>
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Tambah Pengumuman{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form method="post">
|
||||
<h3>Tambah Pengumuman</h3>
|
||||
|
||||
@ -32,5 +30,4 @@
|
||||
|
||||
<button type="submit" name="entry">Entry</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
|
@ -1,22 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Pengumuman</title>
|
||||
</head>
|
||||
<body>
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Pengumuman{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h2>List Pengumuman</h2>
|
||||
|
||||
<h3><a href="#">Pengumuman 1</a></h3>
|
||||
<code><a href="#">Edit</a></code>
|
||||
<h3>Pengumuman 1</h3>
|
||||
<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>
|
||||
|
||||
<h3><a href="#">Pengumuman 1</a></h3>
|
||||
<code><a href="#">Edit</a></code>
|
||||
<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><a href="#">Pengumuman 1</a></h3>
|
||||
<code><a href="#">Edit</a></code>
|
||||
<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>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<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