2017 © Pedro Peláez
 

yii2-extension yii2-imagehandler

A component to handle retriving multi-lingual images from an image repository.

image

mmelcor/yii2-imagehandler

A component to handle retriving multi-lingual images from an image repository.

  • Tuesday, June 27, 2017
  • by mmelcor
  • Repository
  • 2 Watchers
  • 2 Stars
  • 32 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

yii2-imagehandler

Yii2 Multi-language Image Handler

An extension designed to retrive images from an online Repository based on the currently selected application language., (*1)

Installation

The preferred method of installation is via composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist mmelcor/yii2-imagehandler "*"

or add, (*4)

"mmelcor\yii2-imagehander": "*"

to the require section of your composer.json file., (*5)

Usage

Once installed, use it in your application by adding the following to your components section in common\config\main.php (advanced) or config\web.php (basic template) :, (*6)

'components' => [
    '[other components]',
    'imageHandler' => [
        'class' => 'mmelcor\imagehandler',
        'hostUrl' => '[your image repo base url]',
        'siteFolder' => '[base folder]',
        'defaultLang' => '[Language that will have all images]',
    ],
],

In your controller either add the component to your init() by delcaring a protected variable and passing it as a parameter:, (*7)

protected $iHandler;

public function init() {
    $this->iHandler = Yii::$app->imageHandler;
}
$this->parameters = [
    'iHandler' => $this->iHandler,
]:

or pass it to your views in the view action:, (*8)

$iHandler = Yii::$app->imageHandler;

return $this->render('view', [
    'iHandler' => $iHandler,
]);

to call the specific image place the following in your view., (*9)

<img src="<?= $iHandler->getImage('/path/to/img') ?>" class="[classes]" alt="[image description]" />

This component works best with oorrwullie\yii2-babelfishfood., (*10)

The Versions

27/06 2017

dev-master

9999999-dev

A component to handle retriving multi-lingual images from an image repository.

  Sources   Download

MIT

The Requires

 

by Jeremiah Payne
by Kevin Payne

translations yii2 helper image multi-language

27/06 2017

0.6

0.6.0.0

A component to handle retriving multi-lingual images from an image repository.

  Sources   Download

MIT

The Requires

 

by Jeremiah Payne
by Kevin Payne

translations yii2 helper image multi-language

27/02 2017

0.5

0.5.0.0

A component to handle retriving multi-lingual images from an image repository.

  Sources   Download

MIT

The Requires

 

by Jeremiah Payne
by Kevin Payne

translations yii2 helper image multi-language

27/02 2017

0.5.1

0.5.1.0

A component to handle retriving multi-lingual images from an image repository.

  Sources   Download

MIT

The Requires

 

by Jeremiah Payne
by Kevin Payne

translations yii2 helper image multi-language

15/02 2017

0.4.3

0.4.3.0

A component to handle retriving multi-lingual images from an image repository.

  Sources   Download

MIT

The Requires

 

by Jeremiah Payne
by Kevin Payne

translations yii2 helper image multi-language

15/02 2017

0.4.2

0.4.2.0

A component to handle retriving multi-lingual images from an image repository.

  Sources   Download

MIT

The Requires

 

by Jeremiah Payne
by Kevin Payne

translations yii2 helper image multi-language

15/02 2017

0.4

0.4.0.0

A component to handle retriving multi-lingual images from an image repository.

  Sources   Download

MIT

The Requires

 

by Jeremiah Payne
by Kevin Payne

translations yii2 helper image multi-language

15/02 2017

0.3.1

0.3.1.0

A component to handle retriving multi-lingual images from an image repository.

  Sources   Download

MIT

The Requires

 

by Jeremiah Payne
by Kevin Payne

translations yii2 helper image multi-language

15/02 2017

0.3

0.3.0.0

A component to handle retriving multi-lingual images from an image repository.

  Sources   Download

MIT

The Requires

 

by Jeremiah Payne
by Kevin Payne

translations yii2 helper image multi-language

15/02 2017

0.2

0.2.0.0

A component to handle retriving multi-lingual images from an image repository.

  Sources   Download

MIT

The Requires

 

by Jeremiah Payne
by Kevin Payne

translations yii2 helper image multi-language