PHP code example of icron / yii-dynamic-model

1. Go to this page and download the library: Download icron/yii-dynamic-model library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

icron / yii-dynamic-model example snippets


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