Skip to content

Commit

Permalink
Chore(web-twig): Create default controller and template for local web
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Mar 22, 2023
1 parent 533d386 commit 27b6a9f
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 5 deletions.
15 changes: 15 additions & 0 deletions packages/web-twig/app/Controller/DefaultController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class DefaultController extends AbstractController
{
#[Route('/')]
public function index(): Response
{
return $this->render('default.html.twig');
}
}
1 change: 1 addition & 0 deletions packages/web-twig/app/Templates/default.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Hello World</h1>
3 changes: 2 additions & 1 deletion packages/web-twig/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"symfony/runtime": "^5.4",
"symfony/twig-bridge": "5.4.21",
"symfony/twig-bundle": "5.4.21",
"twig/extra-bundle": "^3.5"
"twig/extra-bundle": "^3.5",
"sensio/framework-extra-bundle": "^6.2"
},
"scripts": {
"ecs": "vendor/bin/ecs check --no-progress-bar --ansi src/ tests/",
Expand Down
1 change: 1 addition & 0 deletions packages/web-twig/config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
];
3 changes: 3 additions & 0 deletions packages/web-twig/config/packages/sensio_framework_extra.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sensio_framework_extra:
router:
annotations: false
2 changes: 1 addition & 1 deletion packages/web-twig/config/packages/twig.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
twig:
default_path: '%kernel.project_dir%/templates'
default_path: '%kernel.project_dir%/app/Templates'

when@test:
twig:
Expand Down
6 changes: 3 additions & 3 deletions packages/web-twig/config/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#index:
# path: /
# controller: App\Controller\DefaultController::index
index:
path: /
controller: App\Controller\DefaultController::index
12 changes: 12 additions & 0 deletions packages/web-twig/symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@
"tests/bootstrap.php"
]
},
"sensio/framework-extra-bundle": {
"version": "6.2",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "5.2",
"ref": "fb7e19da7f013d0d422fa9bce16f5c510e27609b"
},
"files": [
"config/packages/sensio_framework_extra.yaml"
]
},
"squizlabs/php_codesniffer": {
"version": "3.7",
"recipe": {
Expand Down

0 comments on commit 27b6a9f

Please sign in to comment.