PHP code example of deesoft / yii2-tools

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

    

deesoft / yii2-tools example snippets


class User extends ActiveRecord
{
    public function onBeforeSave($event)
    {
        // execute at event beforeSave
        // do someting
    }

    public function behaviors()
    {
        return [
            'dee\tools\AutoHandlerBehavior',
        ];
    }
}

// config
'components' => [
    ...
    'profile' => 'dee\tools\State',
]

// this information is unique per client.
Yii::$app->profile->address = 'Jl. Buntu No 3426 Lamongan';

echo Yii::$app->profile->address;

php composer.phar