Skip to content

Commit

Permalink
Merge pull request #42 from mathias73/dev
Browse files Browse the repository at this point in the history
PR dev into master Sprint #1
  • Loading branch information
mathiiii-dev authored Sep 17, 2020
2 parents 49c63cd + b24efbb commit de1841a
Show file tree
Hide file tree
Showing 38 changed files with 2,227 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Composer
composer.phar
composer.bat
/vendor/

# IDE / Editor
Expand Down
4 changes: 4 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"App\\" : "src",
"App\\Controller\\" : "src/Controller"
}
},
"require": {
"twig/twig": "^3.0",
"twbs/bootstrap": "^4.5"
Expand Down
9 changes: 9 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

use App\Router\Router;

require 'vendor/autoload.php';

$router = new Router($_GET['url']);
$router->get('/', 'Home#show');
$router->run();
File renamed without changes.
19 changes: 19 additions & 0 deletions src/Controller/HomeController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Controller;

use Twig\Environment;
use Twig\Loader\FilesystemLoader;

class HomeController
{
public function show()
{
$loader = new FilesystemLoader('src/View');
$twig = new Environment($loader,[
'cache' => false//'src/tmp',
]);

echo $twig->render('home.html.twig');
}
}
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit de1841a

Please sign in to comment.