lepisi-pengumuman/App/Controllers/Posts.php

42 lines
1.4 KiB
PHP

<?php
namespace App\Controllers;
use \Core\View;
class Posts
{
public function index()
{
// 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
View::render('Data/entry_pengumuman.html');
return true;
}
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
View::render(
'Data/edit_pengumuman.html',
[
'category' => 4,
'content' => '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.',
'created_at' => '2017-05-10 10:00',
'creator' => '5',
'edited_at' => '2017-08-10 10:00',
'editor' => '8'
]
);
return true;
}
return false;
}
}