2017 © Pedro Peláez
 

library databag

Data Bag

image

flatphp/databag

Data Bag

  • Tuesday, August 8, 2017
  • by fredyang
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

databag

data bag component, (*1)

install

composer require "flatphp/databag"

usage

use Flatphp\Databag\FilterBag;

class MyData extends FilterBag
{
    protected $rules = array(
        'data1' => 'trim|lower',
        'data2' => ['trim', 'required|email']
    );

    protected $messages = array(
        'data2.required' => 'data2 is required',
        'data2.email' => 'data2 must be email'
    );
}


$data = new MyData(array(
    'data1' => ' hello test ',
    'data2' => ' world'
));


if ($data->fail()) {
    echo $data->getFailedMessage();
} else {
    foreach ($data as $key => $value) {
    echo $key .' - '. $value;
    }
}

The Versions

08/08 2017

dev-master

9999999-dev

Data Bag

  Sources   Download

MIT

The Requires

 

by Fred Yang

databag

08/08 2017

v2.0.1

2.0.1.0

Data Bag

  Sources   Download

MIT

The Requires

 

by Fred Yang

databag

08/08 2017

v2.0.0

2.0.0.0

Data Bag

  Sources   Download

MIT

The Requires

 

by Fred Yang

databag