icron/yii-dynamic-model

DynamicModel is a model class primarily used to support ad hoc data validation

v0.1 2015-08-17 06:17 UTC

This package is auto-updated.

Last update: 2024-12-23 02:57:21 UTC


README

Latest Version Software License Total Downloads

DynamicModel is a model class primarily used to support ad hoc data validation. The typical usage of DynamicModel is as follows,

  $model = new DynamicModel(
      ['name', 'email'],
      [
         ['name, email', 'length', 'max' => 50],
      ]
  );
  if ($model->hasErrors()) {
      // validation fails
  } else {
      // validation succeeds
  }