You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is mandatory to set `_api_resource_class` and `_api_operation_name`in the parameters of the route (`defaults` key). It allows API Platform to work with the Symfony routing system.
410
-
411
-
Alternatively, you can also use a traditional Symfony controller and YAML or XML route declarations. The following example does
412
-
the exact same thing as the previous example:
413
-
414
-
```php
415
-
<?php
416
-
// api/src/Controller/BookController.php
417
-
418
-
namespace App\Controller;
419
-
420
-
use App\Entity\Book;
421
-
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
422
-
use Symfony\Component\HttpKernel\Attribute\AsController;
423
-
424
-
#[AsController]
425
-
class BookController extends AbstractController
426
-
{
427
-
public function createPublication(Book $book, BookPublishingHandler $bookPublishingHandler): Book
0 commit comments