-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Examples for custom controllers #638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Many are missing examples how to use pagination with custom controllers. This could help.
core/pagination.md
Outdated
use ApiPlatform\Core\Bridge\Doctrine\Orm\Paginator; | ||
use Doctrine\Common\Collections\Criteria; | ||
|
||
class BookService |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be the BookRepository
directly right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
core/pagination.md
Outdated
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
class GetBooksByFavoriteAuthorAction extends Controller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be AbstractController
IIRC
Co-Authored-By: martinharder <[email protected]>
Co-Authored-By: martinharder <[email protected]>
The method is moved to the registry. Controller extends AbstractController.
Thanks @martinharder! |
You're welcome! |
Many are missing examples how to use pagination with custom controllers.
This could help.