shaygan/recommender-ir-bundle

A simple wrapper for recommender.ir.

dev-master 2016-07-18 08:07 UTC

This package is auto-updated.

Last update: 2024-04-25 05:48:19 UTC


README

A symfony2 wrapper bundle for Recommender.ir.

Install

Via Composer

$ composer require shaygan/recommender-ir-bundle @dev

Edit your app/AppKernel.php to register the bundle in the registerBundles() method as above:

class AppKernel extends Kernel
{

    public function registerBundles()
    {
        $bundles = array(
            // ...
            // register the bundle here
            new \Shaygan\RecommenderIrBundle\ShayganRecommenderIrBundle()
        );
    }
}

Configure the bundle

This bundle was designed to just work out of the box.

# app/config/config.yml

shaygan_recommender:
    base_uri: http://example.com
    #user_agent: shaygan-recommender-ir (https://github.com/shaygan/recommenderir) 
    #connect_timeout: 30
    #timeout: 30

Usage

Wherever you have access to the service container :

<?php
    // get the api as a service
    $api = $this->container->get('shaygan.recommender');

    // test the API by calling getMe method
    $user = $api->getMe();

?>

License

The MIT License (MIT). Please see License File for more information.