Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Commit 001a728

Browse files
committed
Change the default directory structure and register ActionBundle.
Update dependencies
1 parent e9b7381 commit 001a728

File tree

10 files changed

+72
-52
lines changed

10 files changed

+72
-52
lines changed

app/AppKernel.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public function registerBundles()
1515
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
1616
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
1717
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
18-
new AppBundle\AppBundle(),
1918
];
2019

2120
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {

app/config/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ doctrine:
6060
auto_generate_proxy_classes: "%kernel.debug%"
6161
naming_strategy: doctrine.orm.naming_strategy.underscore
6262
auto_mapping: true
63+
mappings:
64+
App:
65+
type: annotation
66+
is_bundle: false
67+
dir: '%kernel.root_dir%/../src/Entity'
68+
prefix: 'Entity'
69+
alias: App
6370

6471
# Swiftmailer Configuration
6572
swiftmailer:

app/config/routing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
app:
2-
resource: "@AppBundle/Controller/"
1+
action:
2+
resource: "../../src/Controller/"
33
type: annotation

app/config/services.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ parameters:
44
# parameter_name: value
55

66
services:
7-
# service_name:
8-
# class: AppBundle\Directory\ClassName
7+
# 'My\ClassName':
98
# arguments: ["@another_service_name", "plain_value", "%parameter_name%"]

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
"license": "MIT",
44
"type": "project",
55
"description": "The \"Symfony Standard Edition\" distribution",
6+
"repositories": [
7+
{
8+
"type": "vcs",
9+
"url": "https://github.com/dunglas/symfony"
10+
}
11+
],
612
"autoload": {
713
"psr-4": { "": "src/" },
814
"classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
@@ -12,7 +18,7 @@
1218
},
1319
"require": {
1420
"php": ">=5.5.9",
15-
"symfony/symfony": "3.3.x-dev",
21+
"symfony/symfony": "dev-autowirable_controller as 3.3.0",
1622
"doctrine/orm": "^2.5",
1723
"doctrine/doctrine-bundle": "^1.6",
1824
"doctrine/doctrine-cache-bundle": "^1.2",

composer.lock

Lines changed: 31 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AppBundle/AppBundle.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/AppBundle/Controller/DefaultController.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/Controller/Hello.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace Controller;
4+
5+
use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait;
6+
use Symfony\Component\HttpFoundation\Request;
7+
use Symfony\Component\HttpFoundation\Response;
8+
use Symfony\Component\Routing\Annotation\Route;
9+
10+
class Hello
11+
{
12+
use ControllerTrait;
13+
14+
/**
15+
* @Route("/", name="homepage")
16+
*/
17+
public function __invoke(Request $request): Response
18+
{
19+
// replace this example code with whatever you need
20+
return $this->render('default/index.html.twig', [
21+
'base_dir' => realpath(__DIR__.'/../..').DIRECTORY_SEPARATOR,
22+
]);
23+
}
24+
}

src/Entity/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)