file_image — Get a customized file image tag.

New in version 2.2.

File-related functions


file_image($imageType, $props = array(), $file = null)

Get a customized file image tag.

  • $imageType (string) – Image size: thumbnail, square thumbnail, fullsize

  • $props (array) – HTML attributes for the img tag.

  • $file


Display the image files and assign css selectors.

Takes a string for the image size and an array of html attributes.

Valid strings for $imageType include:

  • thumbnail

  • square_thumbnail

  • fullsize

  • original


Display a square thumbnail for an item and wrap it with class = "thumbnail"

<div class="item-collapsed">
    <?php echo file_image('square_thumbnail', array('class' => 'thumbnail'), $file); ?>

See Also