/** * Example of an invokable class, i.e. a class that has an __invoke() method. * * @see http://php.net/manual/en/language.oop5.magic.php#object.invoke */ public function __invoke() { echo $this->twig->render('home.twig', ['articles' => $this->repository->getArticles()]); }