PHP code example of vitalyspirin / yii2-simpleactiverecord
1. Go to this page and download the library: Download vitalyspirin/yii2-simpleactiverecord 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/ */
vitalyspirin / yii2-simpleactiverecord example snippets
use vitalyspirin\yii2\simpleactiverecord\SimpleActiveRecord;
class T1 extends SimpleActiveRecord
{
}
$t1 = new T1(false);
$t1 = new T1();
var_dump($t1->rules());
use vitalyspirin\yii2\simpleactiverecord\SimpleActiveRecord;
class Person extends SimpleActiveRecord
{
// totally empty class
}
$person = new Person(false /*Gii style validation only*/ );
var_dump($person->rules());
$person = new Person();
var_dump($person->rules());