Commit 6a5114b0 authored by Mat's avatar Mat

crée un nouveau APIBundle ->

* php bin/console generate:bundle
* modifie composer.json
* composer.phar dumpautoload
parent aa2bfb4f
......@@ -18,6 +18,7 @@ class AppKernel extends Kernel
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new TechnoBundle\TechnoBundle(),
new AssoBundle\AssoBundle(),
new APIBundle\APIBundle(),
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
......
......@@ -4,6 +4,7 @@ imports:
- { resource: services.yml }
- { resource: "@TechnoBundle/Resources/config/services.yml" }
- { resource: "@AssoBundle/Resources/config/services.yml" }
- { resource: "@APIBundle/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
......
api:
resource: "@APIBundle/Resources/config/routing.yml"
prefix: /
asso:
resource: "@AssoBundle/Resources/config/routing.yml"
prefix: /asso
......
......@@ -5,7 +5,8 @@
"autoload": {
"psr-4": {
"TechnoBundle\\": "src/TechnoBundle",
"AssoBundle\\": "src/AssoBundle"
"AssoBundle\\": "src/AssoBundle",
"APIBundle\\": "src/APIBundle"
},
"classmap": [
"app/AppKernel.php",
......
<?php
namespace APIBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class APIBundle extends Bundle
{
}
<?php
namespace APIBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class DefaultController extends Controller
{
public function indexAction()
{
return $this->render('APIBundle:Default:index.html.twig');
}
}
api_homepage:
path: /
defaults: { _controller: APIBundle:Default:index }
services:
# api.example:
# class: APIBundle\Example
# arguments: ["@service_id", "plain_value", "%parameter%"]
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