Commit a38d0ee0 authored by Mat's avatar Mat

génère un nouveau bundle PotageBundle

parent d5e574fd
......@@ -17,6 +17,7 @@ class AppKernel extends Kernel
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new AppBundle\AppBundle(),
new PotageBundle\PotageBundle(),
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
......
......@@ -2,6 +2,7 @@ imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: services.yml }
- { resource: "@PotageBundle/Resources/config/services.yml" }
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
......
potage:
resource: "@PotageBundle/Resources/config/routing.yml"
prefix: /
app:
resource: '@AppBundle/Controller/'
type: annotation
......@@ -4,6 +4,7 @@
"type": "project",
"autoload": {
"psr-4": {
"PotageBundle\\": "src/PotageBundle",
"AppBundle\\": "src/AppBundle"
},
"classmap": [
......
<?php
namespace PotageBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class DefaultController extends Controller
{
public function indexAction()
{
return $this->render('PotageBundle:Default:index.html.twig');
}
}
<?php
namespace PotageBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class PotageBundle extends Bundle
{
}
potage_homepage:
path: /
defaults: { _controller: PotageBundle:Default:index }
services:
# potage.example:
# class: PotageBundle\Example
# arguments: ["@service_id", "plain_value", "%parameter%"]
<?php
namespace PotageBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testIndex()
{
$client = static::createClient();
$crawler = $client->request('GET', '/');
$this->assertContains('Hello World', $client->getResponse()->getContent());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment