Skip to content
This repository has been archived by the owner on Apr 27, 2019. It is now read-only.

harmstyler/clarify-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HarmsTylerClarifyBundle

The HarmsTylerClarifyBundle is a symfony wrapper bundle for the Clarify php helper library. Much of the Extension code is inspired by the NelmioSolariumBundle.

SensioLabsInsight

Installation

Add HarmsTylerClarifyBundle in your composer.json:

{
    "require": {
        "harmstyler/clarify-bundle": "dev-master"
    }
}

Download bundle:

$ php composer.phar update harmstyler/clarify-bundle

Register HarmsTylerClarifyBundle with your AppKernel.php

public function registerBundles()
{
    $bundles = array(
        ...
        new HarmsTyler\ClarifyBundle\HarmsTylerClarifyBundle(),
        ...
    );
    ...
}

Basic configuration

Declare a default app:

harms_tyler_clarify:
    apps:
        default:
            api_key: <api_key>

Usage

$bundle = $this->get('clarify.app');
$result = $bundle->search('close');
$results = $result['item_results'];

Multiple apps

harms_tyler_clarify:
    apps:
        default:
            api_key: <api_key>
        another:
            api_key: <api_key>
$defaultBundle = $this->get('clarify.app');
$anotherBundle = $this->get('clarify.app.another');

You can also swap the default name with your own, doing so will require declaring the default app:

harms_tyler_clarify:
    default_app: firstApp
    apps:
        firstApp:
            api_key: <api_key>
        secondApp:
            api_key: <api_key>
$firstApp = $this->get('clarify.app');
//or
$firstApp = $this->get('clarify.app.firstApp');

$secondApp = $this->get('clarify.app.secondApp');

License

Released under the MIT License, see LICENSE.

About

A wrapper bundle for the Clarify php helper library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages