Esempio n. 1
0
 /**
  * @param ServerRequestInterface $request
  * @param ResponseInterface $response
  * @param callable $next
  */
 public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next)
 {
     $userId = $request->getAttribute('user_id');
     $user = $this->userFinder->findById($userId);
     $todos = $this->todoFinder->findByAssigneeId($userId);
     return new HtmlResponse($this->templates->render('page::user-todo-list', ['user' => $user, 'todos' => $todos]));
 }