Jump to content

Find image by image name ?


pwired
 Share

Recommended Posts

Finding images goes like this:

$image = $page->images->first();
$image = $page->images->getRandom();

How do you find an image by it´s image name, e.g. picture.jpg ?

Is it possible to find an image by it's image name ?

Maybe something like this:   $image = $page->images->{picture.jpg}();

If that is not possible what about using the api for finding

images that you store in the assets folder ?

$image = $page->images-> { url to the picture in the assets folder}();

If that is also not possible, then would it be possible to use php code:

$image = php code { url to the picture in the assets folder}();

If that is also not possible, then is the img tag the only possibility ?

<img src="<?php echo $config->urls->site?>assets/pics/picture.jpg"/>

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...