Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function getHtmlLink(EntityManagerInterface $em)
- {
- $repository = $em->getRepository(static::class);
- $videos = $repository->findAll();
- $basicLinks = [];
- foreach ($videos as $video) {
- $basicLinks[] = $video->getLink();
- }
- $parts = [];
- foreach ($basicLinks as $link) {
- $parts[] = explode('=', $link);
- }
- $linksId = [];
- foreach ($parts as $value) {
- $linksId[] = $value[1];
- }
- $htmlLinks = [];
- foreach ($linksId as $value) {
- $htmlLinks[] = 'https://www.youtube.com/embed/' . $value .'?ecver=2';
- }
- return $htmlLinks;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement