summaryrefslogtreecommitdiff
path: root/src/Controller/Home.php
blob: 511b89bbea261bf885bc800e221354e14d9407bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

namespace Elements\Controller;

use Elements\DB;
use Elements\Model\Card;
use Elements\Template;

class Home
{
  public static function index()
  {
    $c = DB::$entityManager->getRepository(Card::class)->findOneBy([], ['id' => 'DESC']);
    echo "<pre>";
    $c && var_dump(
      array_map(fn ($item) => [$item->key, $item->value], $c->meta->toArray()),
    );

    return Template::render('home.twig');
  }
}