The most chill blog framework ever https://fipamo.blog
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

34 lines
926 B

  1. <?php
  2. use Psr\Http\Message\ResponseInterface as Response;
  3. use Psr\Http\Message\ServerRequestInterface as Request;
  4. use Slim\Factory\AppFactory;
  5. use Slim\Views\Twig;
  6. use Slim\Views\TwigMiddleware;
  7. include 'brain/controller/IndexControl.inc.php';
  8. include 'brain/data/Settings.inc.php';
  9. require __DIR__ . '/vendor/autoload.php';
  10. $app = AppFactory::create();
  11. $twig = Twig::create('brain/views/default/');
  12. $app->add(TwigMiddleware::create($app, $twig));
  13. //Dashboard Index
  14. $app->get('/dashboard', function (Request $request, Response $response) {
  15. $index = new IndexControl();
  16. $settings = new Settings();
  17. $folks = $settings->getFolks();
  18. $secret = $index->getSecret();
  19. $view = Twig::fromRequest($request);
  20. return $view->render($response, 'index.twig', [
  21. 'title' => 'This is Fipamo',
  22. 'name' => 'Ro',
  23. 'occupation'=>'pretty cool... I guess',
  24. 'folks' => $folks[0]['handle'],
  25. 'secret' => $secret
  26. ]);
  27. });
  28. $app->run();