<?php namespace App\Controller; use Symfony\Component\HttpFoundation\Response; use App\Items\Video; class DefaultController extends \Symfony\Bundle\FrameworkBundle\Controller\Controller { private $links; public function __construct() { $this->links = [ 'https://www.youtube.com/watch?v=ubrLxJrtcX0' ]; } public function index(): Response { $videos = []; foreach ($this->links as $link) { $videos[] = new Video($link); } return $this->render('index.html.twig', ['items' => $videos]); } }