refactor: ♻️ refactor out post-type specific code
This commit is contained in:
parent
9e855fba36
commit
38a5056ff0
3 changed files with 129 additions and 139 deletions
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
|
||||
require_once 'vendor/autoload.php';
|
||||
require_once 'mysql_adapter.php';
|
||||
require_once 'post_adapter.php';
|
||||
|
||||
// $sql = mysqli_connect('mysql', 'root', 'example', 'dragon_fire');
|
||||
|
||||
$adapter = new MySQLAdapter();
|
||||
$adapter = new PostHandler();
|
||||
|
||||
//if (!$sql)
|
||||
// {
|
||||
|
@ -77,7 +77,7 @@ if($SURI == '/') {
|
|||
"subposts" => $post['subposts']
|
||||
]);
|
||||
}
|
||||
elseif($post['post_metadata']['type'] == 'file') {
|
||||
elseif($post['post_metadata']['type'] == 'image') {
|
||||
echo $twig->render('post_types/image.html', [
|
||||
"post" => $post
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue