PHP code example of horat1us / yii2-uuid-behavior

1. Go to this page and download the library: Download horat1us/yii2-uuid-behavior 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/ */

    

horat1us / yii2-uuid-behavior example snippets




namespace App;

use Horat1us\Yii\UuidBehavior;
use yii\db;

/**
* Class Record
 * @package App
 * 
 * @property string $uuid // primary key in database, without default value and auto-increment
 */
class Record extends db\ActiveRecord
{
    public function behaviors(): array {
        return [
            'uuid' => [
                'class' => UuidBehavior::class,    
            ],    
        ];
    }
}