2017 © Pedro Peláez
 

library modlr-bundle

Symfony bundle for the Modlr REST ODM library.

image

as3/modlr-bundle

Symfony bundle for the Modlr REST ODM library.

  • Wednesday, October 19, 2016
  • by zarathustra323
  • Repository
  • 3 Watchers
  • 2 Stars
  • 8,431 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 1 Versions
  • 5 % Grown

The README.md

As3ModlrBundle

Scrutinizer Code Quality Build Status Packagist SensioLabsInsight, (*1)

Integrates the modlr REST libraries with Symfony., (*2)

Installation

To utilize modlr, you must install a persister and an api specification., (*3)

To utilize search within modlr, you must install a search client., (*4)

Available modules can be found here, or you can write your own!, (*5)

Install packages with Composer

To install this bundle with support for MongoDB, elasticsearch and the JSON Api Spec, add the following to your composer.json file:, (*6)

{
    "require": {
        "as3/modlr-bundle": "dev-master",
        "as3/modlr-api-jsonapiorg": "dev-master",
        "as3/modlr-search-elastic": "dev-master",
        "as3/modlr-persister-mongodb": "dev-master"
    }
}

Then, tell Composer to update and install the requested packages:, (*7)

composer update as3/modlr-bundle --with-dependencies

Register the Bundle

Once installed, register the bundle in your AppKernel.php:, (*8)

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new As3\Bundle\ModlrBundle\As3ModlrBundle(),
    );

    // ...
}

Configuration

Modlr requires some configuration in order to work. You can use the default config below to get started:, (*9)

# app/config/config.yml
as3_modlr:
    rest:
        root_endpoint: /api
        debug: "%kernel.debug%"
    adapter:
        type: jsonapiorg
    persisters:
        default:
            type: mongodb
            parameters:
                host: mongodb://localhost:27017
    search_clients:
        default:
            type: elastic

To utilize the external REST API, you must also include modlr's routing file. This will allow modlr to handle all requests to as3_modlr.rest.root_endpoint. To prevent any routing conflicts, you should add this before any other bundle or your application route definitions., (*10)

# app/config/routing.yml
as3_modlr_bundle:
    resource: "@As3ModlrBundle/Resources/config/routing.yml"

Next you must define your models! By default, modlr's metadata driver will look for YAML files in app/Resources/As3ModlrBundle/models and app/Resources/As3ModlrBundle/mixins., (*11)

You can customize where your definitions are stored by setting the models_dir parameter of your metadata driver. See the bundle configuration documentation for more information., (*12)

Usage

See modlr documentation for additional information., (*13)

This bundle provides commands to rebuild modlr's metadatacache:, (*14)

app/console as3:modlr:metadata:cache:clear [model_type] [--no-warm]

Create collection schema:, (*15)

app/console as3:modlr:schema:create [model_type]

The Versions

19/10 2016

dev-master

9999999-dev

Symfony bundle for the Modlr REST ODM library.

  Sources   Download

Apache-2.0

The Requires

 

by Jacob Bare