arobases-sylius-public/sylius-instagram-plugin

Provide Instagram Feed on Sylius


README

68747470733a2f2f64656d6f2e73796c6975732e636f6d2f6173736574732f73686f702f696d672f6c6f676f2e706e67

ArobasesSyliusInstagramPlugin

Provide Instagram Feed on Sylius.

Installation

Composer

composer require arobases-sylius-public/sylius-instagram-plugin

Use ChannelTrait and ChannelInterface:

<?php

declare(strict_types=1);

namespace App\Entity\Channel;

use Arobases\SyliusInstagramPlugin\Model\ChannelInterface;
use Arobases\SyliusInstagramPlugin\Model\ChannelTrait;
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Channel as BaseChannel;

/**
 * @ORM\Entity
 * @ORM\Table(name="sylius_channel")
 */
class Channel extends BaseChannel implements ChannelInterface
{
    use ChannelTrait;
}

Update the schema

php bin/console doctrine:schema:update --force

Now you have access to an array representing the response of instagram

You can use it everywhere you want and render like you want

{% include "@ArobasesSyliusInstagramPlugin/Instagram/_instagram.html.twig" with {'data' : app_get_instagram_feed() } %}