In my PHP application I am displaying embedded videos from various sources - youtube, vimeo etc.
In my articles table I store the id of my embed videos:
Article.video_url = 'e5dkjwkdek'
Then in my video_providers table I store the embed code, but I want to dynamically add the video_url, so I store:
VideoProviders.embedcode = "https://www.youtube.com/embed/$article->video_url"
I then output the 'embedcode' variable in my template and I want to append the $article->video_url which is the unique id of the video.
It seems I need a variable within the variable, I tried:
VideoProviders.embedcode = "https://www.youtube.com/embed/{$article->video_url}"
and
VideoProviders.embedcode = "https://www.youtube.com/embed/$$article->video_url"
But it seems these are simply treated as literal strings. If anyone has any better suggestions as to how to achieve this I am all ears. In short I want the mark-up stored in one place so that is can be edited should the embed code of the provider change.