Ivans84
173
4
General

Different file formats in URL::asset(...)

Posted 1 year ago by Ivans84

Hello everybody.

I have a web page with some pictures. Most of them are in .jpg format, but I also have some in .png format. I need to make a universal link which could let me display both format pictures. At the moment my code looks like this:

<div>
    <a href="{{ URL::asset('images/pages/albums/'.$albumName.'/'.$picture->pictureName.'.jpg') }}">
        <img src="{{ URL::asset('images/pages/albums/'.$albumName.'/small/'.$picture->pictureName.'.jpg' }}">
    </a>
</div>

If you can help me please, how I need to change the line started with "<a href..." and "<img...", so two formats could be displayed?

Please sign in or create an account to participate in this conversation.