This commit is contained in:
Marcel Pociot
2020-04-25 11:42:40 +02:00
parent c89f6b38ea
commit 28c4009dff
16 changed files with 81 additions and 74 deletions

View File

@@ -29,7 +29,7 @@ class ListUsersController extends PostController
{
$this->database->query('SELECT * FROM users ORDER by created_at DESC')->then(function (Result $result) use ($httpConnection) {
$httpConnection->send(
respond_html($this->getView(['users' => $result->rows]))
respond_html($this->getView('server.users.index', ['users' => $result->rows]))
);
$httpConnection->close();
@@ -39,15 +39,4 @@ class ListUsersController extends PostController
$httpConnection->close();
});
}
protected function getView(array $data)
{
$twig = new Environment(
new ArrayLoader([
'template' => file_get_contents(base_path('resources/views/admin/users/index.twig')),
])
);
return stream_for($twig->render('template', $data));
}
}