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
Requires
- php: >=7.2.5
- ext-json: *
- doctrine/doctrine-bundle: ^2.0
- doctrine/orm: ^2.3
- symfony/config: ^4.0|^5.0|^6.0
- symfony/dependency-injection: ^4.0|^5.0|^6.0
- symfony/finder: ^4.0|^5.0|^6.0
- symfony/security-bundle: ^4.0|^5.0|^6.0
- symfony/twig-bridge: ^4.0|^5.0|^6.0
- symfony/yaml: ^4.0|^5.0|^6.0
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: