Routes symfony

Notes

Routes symfony

 
0 Kudos
Don't
move!

Debuger ses routes

php bin/console debug:router 

 

Pour avoir un système facile de routes grâce au commentaires

composer require annotations

On créer notre controller

Controller

<?php
/**
* Created by PhpStorm.
* User: macdavid
* Date: 25/05/2018
* Time: 23:03
*/

namespace App\Controller;

use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Response;

class UniqueController
{
  /**
  * @Route("/unique/show")
  */
  public function showUnique(){

    return new Response(
      'Numéro unique :'. uniqid()
    );
  }
}

 

Voir ses routes

php bin/console debug:router