PHPackages                             encoda/ss-image-helpers - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. encoda/ss-image-helpers

ActiveSilverstripe-module[Utility &amp; Helpers](/categories/utility)

encoda/ss-image-helpers
=======================

SilverStripe View Helpers module

0.0.1.x-dev(11y ago)1321[3 PRs](https://github.com/encoda/ss-image-helpers/pulls)MITPHP

Since Jan 27Pushed 10y ago3 watchersCompare

[ Source](https://github.com/encoda/ss-image-helpers)[ Packagist](https://packagist.org/packages/encoda/ss-image-helpers)[ Docs](http://github.com/encoda/ss-image-helpers)[ RSS](/packages/encoda-ss-image-helpers/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

SilverStripe Image Helpers Module
=================================

[](#silverstripe-image-helpers-module)

SS-image-helpers is a SilverStripe Module that provides some template methods, a.k.a., View Helpers, for image usage.

Works fine with [SS-Image-Min](https://github.com/encoda/ss-image-min).

Requirements
------------

[](#requirements)

SilverStripe Framework 3.0+

Installation
------------

[](#installation)

### Composer

[](#composer)

Create a composer.json file:

```
{
    "require" : {
        "encoda/ss-image-helpers": "0.0.0"
    }
}
```

Navigate to your project root and run the install command.

`$ composer install`

### Github

[](#github)

Navigate to the root directory of your SilverStripe application and execute `git clone https://github.com/encoda/ss-image-helpers.git`

### Manually

[](#manually)

Download [this zip file](https://github.com/encoda/ss-image-helpers/zipball/master) and extract it in your SilverStripe root directory.

Usage
-----

[](#usage)

### ImageAbsoluteUrl( string $image\_file\_name )

[](#imageabsoluteurl-string-image_file_name-)

Returns the `AbsoluteUrl` for the `Image` of the given file name, starting with the application `absoluteBaseURL`.

```

```

### ImageRelativeUrl( string $image\_file\_name )

[](#imagerelativeurl-string-image_file_name-)

Returns the `RelativeLink` for the `Image` of the given file name.

```

```

### ImageUrl( string $image\_file\_name )

[](#imageurl-string-image_file_name-)

Returns the `Url` for the `Image` of the given file name, starting with the application `baseURL`.

```

```

### ImageTag( string $image\_file\_name )

[](#imagetag-string-image_file_name-)

Returns the html `Tag` for the `Image` of the given file name.

```
  $ImageTag('example.png')

```

Configurations
--------------

[](#configurations)

### Image Paths

[](#image-paths)

By default, when any of the helpers methods is used to insert an image in the template, the module searches for the image file, by its name, in the following directories:

- assets/
- assets/images/
- themes/{current theme}/images/

Images out of the the Images Path are ignored by the helpers. To add new directories to the Images Path, add the following line to your `_config.php`.

```
