2017 © Pedro Peláez
 

yii2-extension yii2-instafeed

Yii2 extension for instafeed Instagram javascript plugin

image

nirvana-msu/yii2-instafeed

Yii2 extension for instafeed Instagram javascript plugin

  • Saturday, July 30, 2016
  • by nirvana-msu
  • Repository
  • 2 Watchers
  • 6 Stars
  • 169 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

yii2-instafeed

Yii2 extension for instafeed Instagram javascript plugin, providing a simple way to add Instagram photos to your website., (*1)

This widget publishes assets and registers necessary code to run plugin. It also optionally renders a div container that plugin would automatically look for, to fill with thumbnails. You can control the name of a created javascript plugin variable by configuring widget id., (*2)

Resources

Installation

Composer

Add extension to your composer.json and update your dependencies as usual, e.g. by running composer update, (*3)

{
    "require": {
        "nirvana-msu/yii2-instafeed": "1.0.*@dev"
    }
}

Widget Configuration

  • $renderThumbnailDiv boolean whether to render <div id="instafeed"></div> container that plugin would look for by default
  • $pluginOptions array instafeed javascript plugin options. For more information refer to instafeed documentation

Sample Usage

The only thing you have to configure are plugin option. For example, to fetch images from your account, set the get, userId and accessToken options:, (*4)

echo Instafeed::widget([
    'pluginOptions' => [
        'get' => 'user',
        'userId' => 'YOUR_USER_ID',     // your Instagram account id, not username!
        'accessToken' => 'YOUR_ACCESS_TOKEN',
    ],
]);

If, for convenience, you prefer to store application-wide configuration such as access token(s), client id(s) and user id(s) in an application component, you may find InstafeedConfig class useful, for example:, (*5)

In an application config:, (*6)

'components' => [
    'instafeedConfig' => [
        'class' => InstafeedConfig::className(),
        'userId' => 'YOUR_USER_ID',
        'accessToken' => 'YOUR_ACCESS_TOKEN',
    ],
],

In a view:, (*7)

$config = Yii::$app->instafeedConfig;
echo Instafeed::widget([
    'pluginOptions' => [
        'get' => 'user',
        'userId' => $config->userId,
        'accessToken' => $config->accessToken,
    ],
]);

License

Extension is released under MIT license., (*8)

The Versions

30/07 2016

dev-master

9999999-dev

Yii2 extension for instafeed Instagram javascript plugin

  Sources   Download

MIT

The Requires

 

by Alexander Stepanov

plugin yii2 javascript widget instagram instafeed