Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

jmcneese/metadata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metadata Plugin for CakePHP 2.0+

Metadata provides storage of arbitrary n-deep arrays of data related to a particular model record

Installation

  • Clone/Copy the files in this directory into app/plugins/metadata

  • Include the metadata behavior in the models you wish to have metadata: var $actsAs = array('Metadata.Metadata' => array( 'validate' => array( 'fieldName' => array( 'rule' => 'postal', 'message' => 'Must be valid postal code', ), 'some' => array( 'nested' => array( 'array' => array( array( 'rule' => 'numeric', 'message' => 'Must be numeric' ), array( 'rule' => array( 'decimal', 2 ), 'message' => 'Must be decimal' ) ) ) ) ) ));

  • Define any validation rules that you need, in a similar fashion to model validation rules (all the built-in Validator rules work). Multiple rules per node are supported, and nodes can be as deep as required.

Documentation

Further documentation including additional ways of configuring Metadata can be found here.

Reporting issues

If you have any issues with Metadata please open a ticket on the github issue tracker

Contributing

If you'd like to contribute to Metadata, feel free to fork the project and submit patches!

About

A CakePHP plugin that provides arbitrary metadata storage for model records

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages