glavweb/data-schema-bundle

There is no license information available for the latest version (v2.2.0) of this package.

GLAVWEB DataSchemaBundle

v2.2.0 2023-05-23 07:56 UTC

This package is auto-updated.

Last update: 2024-10-23 11:04:15 UTC


README

Get the bundle using composer

Add GlavwebDataSchemaBundle by running this command from the terminal at the root of your Symfony project:

php composer.phar require glavweb/data-schema-bundle

Enable the bundle

To start using the bundle, register the bundle in your application's kernel class:

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new Glavweb\DataSchemaBundle\GlavwebDataSchemaBundle(),
        // ...
    );
}

Configure the bundle

This bundle was designed to just work out of the box. The only thing you have to configure in order to get this bundle up and running is a mapping.

# app/config/config.yml

# Add hydrators to Doctrine
doctrine:
    orm:
        hydrators:
            DatagridHydrator: Glavweb\DataSchemaBundle\Hydrator\Doctrine\DatagridHydrator

glavweb_data_schema:
    default_hydrator_mode: DatagridHydrator
    data_schema:
        dir: "%kernel.root_dir%/config/data_schema"

    scope:
        dir: "%kernel.root_dir%/config/scopes"
            

Basic Usage

Define data schema:

# app/config/data_schema/article.schema.yml

schema:
    class: AppBundle\Entity\Article
    properties:
        id:
        name:
        slug:
        body:

Define scope:

# app/config/scopes/article/short.yml

scope:
    name: