public function renderDefault() { $this->template->genres = $this->genres; $this->template->songsWithoutGenre = $this->songsManager->getSongsWithoutGenre(); /** Song[][] */ $songs = []; foreach ($this->genres as $genre) { $songs[$genre->getId()] = $this->songsManager->getSongsByGenreId($genre->getId()); } $this->template->songs = $songs; }