PHP code example of yiicod / yii2-base

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

    

yiicod / yii2-base example snippets


    /**
     * Attributes mapper(Dynamic attr by mapping).
     * yiicod\base\models\behaviors\AttributesMapBehavior
     * $model->title // But in db it can be title_ext
     * $model->alias // But in db it can be slug
     */
    [
        'class' => 'yiicod\base\models\behaviors\AttributesMapBehavior',
        'attributesMap' => [
            'fieldTitle' => 'title_ext',
            'fieldAlias' => 'slug',
        ]
    ],
    /**
     * HTMLPurify
     */
    [
        'class' => 'yiicod\base\models\behaviors\XssBehavior',
    ]

php composer.phar