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

Latest commit

 

History

History
47 lines (37 loc) · 1.39 KB

README.mdown

File metadata and controls

47 lines (37 loc) · 1.39 KB

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!