Guest User

Untitled

a guest
Dec 11th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * @Route("/posts/list")
  5. */
  6. class PostListController extends AbstractController
  7. {
  8. public function __invoke(MessageBusInterface $bus): Response
  9. {
  10. $envelop = $bus->dispatch(new GetPostQuery(0, 5));
  11.  
  12. /** @var HandledStamp $stamp */
  13. if ($stamp = $envelop->last(HandledStamp::class)) {
  14. $posts = $stamp->getResult();
  15. }
  16.  
  17. return $this->render('post.html.twig', ['posts' => $posts ?? []]);
  18. }
  19. }
Add Comment
Please, Sign In to add comment