Код: Выделить всё
app_todo_create:
path: /api/todo/create
controller: App\Todo\Infrastructure\Controller\TodoController::create
methods: [POST]
app_todo_find:
path: /api/todo/find/{id}
controller: App\Todo\Infrastructure\Controller\TodoController::find
methods: [GET]
app_todo_find_all:
path: /api/todo/findAll
controller: App\Todo\Infrastructure\Controller\TodoController::findAll
methods: [GET]
app_todo_edit:
path: /api/todo/edit
controller: App\Todo\Infrastructure\Controller\TodoController::edit
methods: [PUT]
app_todo_delet:
path: /api/todo/delete
controller: App\Todo\Infrastructure\Controller\TodoController::delete
methods: [DELETE]
Код: Выделить всё
namespace App\Todo\Infrastructure\Controller;
use App\Todo\Application\Command\CreateTodoCommand;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class TodoController extends AbstractController
{
public function create(Request $request): Response
{
return new JsonResponse([]);
}
Код: Выделить всё
Name Method Scheme Host Path
------------------- -------- -------- ------ --------------------------
_preview_error ANY ANY ANY /_error/{code}.{_format}
app_todo_create POST ANY ANY /api/todo/create
app_todo_find GET ANY ANY /api/todo/find/{id}
app_todo_find_all GET ANY ANY /api/todo/findAll
app_todo_edit PUT ANY ANY /api/todo/edit
app_todo_delet DELETE ANY ANY /api/todo/delete
------------------- -------- -------- ------ --------------------------
+- -------------+------------------------------------ --------------------------------------+
| Недвижимость | Ценность |
Код: Выделить всё
+--------------+--------------------------------------------------------------------------+
| Route Name | app_todo_create |
| Path | /api/todo/create |
| Path Regex | {^/api/todo/create$}sDu |
| Host | ANY |
| Host Regex | |
| Scheme | ANY |
| Method | POST |
| Requirements | NO CUSTOM |
| Class | Symfony\Component\Routing\Route |
| Defaults | _controller: App\Todo\Infrastructure\Controller\TodoController::create() |
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
| | utf8: true |
+--------------+--------------------------------------------------------------------------+
Подробнее здесь: https://stackoverflow.com/questions/792 ... on-symfony
Мобильная версия