You cannot 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
PHTML
34 lines
926 B
PHTML
4 years ago
|
<?php
|
||
|
use Psr\Http\Message\ResponseInterface as Response;
|
||
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||
|
use Slim\Factory\AppFactory;
|
||
|
use Slim\Views\Twig;
|
||
|
use Slim\Views\TwigMiddleware;
|
||
|
|
||
|
include 'brain/controller/IndexControl.inc.php';
|
||
|
include 'brain/data/Settings.inc.php';
|
||
|
|
||
|
require __DIR__ . '/vendor/autoload.php';
|
||
|
$app = AppFactory::create();
|
||
|
$twig = Twig::create('brain/views/default/');
|
||
|
$app->add(TwigMiddleware::create($app, $twig));
|
||
|
|
||
|
//Dashboard Index
|
||
|
$app->get('/dashboard', function (Request $request, Response $response) {
|
||
|
$index = new IndexControl();
|
||
|
$settings = new Settings();
|
||
|
$folks = $settings->getFolks();
|
||
|
$secret = $index->getSecret();
|
||
|
$view = Twig::fromRequest($request);
|
||
|
|
||
|
return $view->render($response, 'index.twig', [
|
||
|
'title' => 'This is Fipamo',
|
||
|
'name' => 'Ro',
|
||
|
'occupation'=>'pretty cool... I guess',
|
||
|
'folks' => $folks[0]['handle'],
|
||
|
'secret' => $secret
|
||
|
]);
|
||
|
});
|
||
|
|
||
|
$app->run();
|