PHP code example of thtmorais / yii2-dropdown

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

    

thtmorais / yii2-dropdown example snippets


<?= Dropdown::widget([
    'dropdownToggleClass' => 'btn btn-lg btn-success',
    'main' => [
        'id' => 'getStartedWithYii',
        'href' => 'http://www.yiiframework.com/',
        'class' => 'btn btn-lg btn-success',
        'text' => 'Get started with Yii'
    ],
    'subordinate' => [
        [
            'id' => 'yiiDocumentation',
            'href' => 'http://www.yiiframework.com/doc/',
            'text' => 'Yii Documentation'
        ],
        [
            'id' => 'yiiForum',
            'href' => 'http://www.yiiframework.com/forum/',
            'text' => 'Yii Forum'
        ],
        [
            'id' => 'yiiExtensions',
            'href' => 'http://www.yiiframework.com/extensions/',
            'text' => 'Yii Extensions'
        ]
    ],
    'options' => [
        'id' => 'group-dropdown',
        'class' => 'p-1'
    ]
])