PHP code example of yidas / yii2-bootstrap

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

    

yidas / yii2-bootstrap example snippets


yidas\yii\bootstrap\BootstrapAsset

\yidas\yii\bootstrap\BootstrapAsset::register($this);

namespace app\assets;
use yii\web\AssetBundle;
class AppAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
        'css/site.css',
    ];
    public $js = [
    ];
    public $depends = [
        'yii\web\YiiAsset',
        'yidas\yii\bootstrap\BootstrapAsset'
    ];
}

'components' => [
    'assetManager' => [
        'bundles' => [
            'yidas\yii\bootstrap\BootstrapAsset' => [
                'cdn' => true,
                // 'cdnVersion' => '4.1.3',
            ],
        ],
    ],
],

'assetManager' => [
    'bundles' => [
        'yidas\yii\fontawesome\FontawesomeAsset' => [
            'cdn' => true,
            'cdnCSS' => ['https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css'],
            'cdnJS' => ['https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js'],
        ],
    ],
],

    public $depends = [
        //'yii\web\JqueryAsset',
        'yidas\yii\jquery\JqueryAsset',
        'yidas\yii\bootstrap\BootstrapAsset'
    ];

'components' => [
    'assetManager' => [
        'bundles' => [
            'yidas\yii\bootstrap\BootstrapAsset' => [
                'jquery' => true,
                // 'cdn' => true,
            ],
            'yidas\yii\jquery\JqueryAsset' => [
                // 'cdn' => true,
            ],
        ],
    ],   
],