Jump to content

Selecting image from image array


mtn
 Share

Recommended Posts

On a "site-settings" page, I have a "watches" image field that contains 5 images.  The first and last are easily echo-ed with"$a->first();" and "$a->last();", but I am having difficulty in creating the correct syntax to display images 2-4.  Any help would be appreciated.  Thank you!

Present code:

<?php $selectWatch = $pages->get("/site-settings/")->watches;
   $watchOne = $selectWatch->first();
    echo "<img src='{$watchOne->url}' alt='{$watchOne->description}' class='time'>";

?>

 

Link to comment
Share on other sites

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...