Ajvanho's avatar
Level 14

check in blade, is it iframe exist

I want to display from database iframe embed links. For example: </i frame>

How to check in blade, is this correct iframe that exist?

Something similar to this: {{ "corect-iframe" ? $iframe : 'iframe is not valid'}}

0 likes
1 reply
Tray2's avatar

Not sure why you would use an iframe for that at all and not sure what you mean by correct iframe either.

But if you have several of these iframes you just change the url for them to get what you need.

 <iframe src="https://yoursite.com/links/utils"></iframe>

 <iframe src="https://yoursite.com/links/applcations"></iframe>  

But I think iframes is a bad choice since it needs to do more requests to the server. It's better to do a partial that you can reuse multiple times while still on the serverside.

This tutorial covers that in a clever way https://laracasts.com/series/javascript-techniques-for-server-side-developers/episodes/1

1 like

Please or to participate in this conversation.