2017 © Pedro Peláez
 

library flexmodel

An XML-based model (object / view / form) configuration library.

image

flexmodel/flexmodel

An XML-based model (object / view / form) configuration library.

  • Monday, March 20, 2017
  • by niels-nijens
  • Repository
  • 1 Watchers
  • 1 Stars
  • 5,263 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 5 Forks
  • 1 Open issues
  • 6 Versions
  • 2 % Grown

The README.md

FlexModel

Latest version on Packagist Software License ![Build Status][ico-build] [Coverage Status][link-coverage] SensioLabsInsight, (*1)

An ORM agnostic model (object / view / form) configuration library., (*2)

Installation using Composer

Run the following command to add the package to the composer.json of your project:, (*3)

``` bash $ composer require flexmodel/flexmodel, (*4)


## Usage Load a FlexModel configuration file: ``` php load('flexmodel.xml'); $flexModel = new FlexModel(); $flexModel->load($domDocument, 'path/to/cache/directory'); ``` ## The FlexModel XML format A minimal FlexModel object definition consists of an object name and model definition with fields: ``` xml <flexmodel> <object name='TheNameOfTheObject'> <fields> <field name='name_of_the_field' datatype='VARCHAR'/> </fields> </object> </flexmodel>

The object model configuration

The model is defined by one or more field nodes in the fields node of the object, like the example above shows. Each field has a datatype defined and a unique field name., (*5)

Field datatypes

These are the various datatypes that can be defined for a field: * BOOLEAN * DATE * DATEINTERVAL * DATETIME * DECIMAL * FILE * FLOAT * HTML * INTEGER * JSON * TEXT * SET * VARCHAR, (*6)

Creating references between objects

References between objects are created by adding a field with an 'OBJECT.ObjectName' datatype., (*7)

In the example below you can see an object with the name 'ReferencingObject' with a field refering to an object with the name 'ReferencedObject: xml <?xml version='1.0' encoding='UTF-8'?> <flexmodel> <object name='ReferencingObject'> <fields> <field name='referenced_object' datatype='OBJECT.ReferencedObject'/> </fields> </object> <object name='ReferencedObject'> <fields> <field name='some_other_field' datatype='VARCHAR'/> </fields> </object> </flexmodel>, (*8)

Credits and acknowledgements

Also see the list of contributors who participated in this project., (*9)

The Versions

20/03 2017

dev-master

9999999-dev

An XML-based model (object / view / form) configuration library.

  Sources   Download

MIT

The Requires

  • php ^5.4 | ^7.0

 

The Development Requires

07/02 2017

1.1.1

1.1.1.0

An XML-based model (object / view / form) configuration library.

  Sources   Download

MIT

The Requires

  • php ^5.4 | ^7.0

 

The Development Requires

22/09 2016

1.1.0

1.1.0.0

An XML-based model (object / view / form) configuration library.

  Sources   Download

MIT

The Requires

  • php ^5.4 | ^7.0

 

The Development Requires

19/09 2016

1.0.0

1.0.0.0

An XML-based model (object / view / form) configuration library.

  Sources   Download

MIT

The Requires

  • php ^5.4 | ^7.0

 

The Development Requires

14/04 2016

0.2.0

0.2.0.0

An XML-based model (object / view / form) configuration library.

  Sources   Download

MIT

The Requires

  • php ^5.4 | ^7.0

 

The Development Requires

18/03 2016

0.1.0

0.1.0.0

An XML-based model (object / view / form) configuration library.

  Sources   Download

MIT

The Requires

  • php ^5.4 | ^7.0

 

The Development Requires