PHP code example of worstinme / yii2-uikit

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

    

worstinme / yii2-uikit example snippets


\worstinme\uikit\Asset::register($this);
\worstinme\uikit\IconAsset::register($this);

$form = ActiveForm::begin([
    'layout'=>'horizontal', // also available 'stacked' option
]);

$form = ActiveForm::begin([
    'layout'=>'stacked',
    'grid'=>true,
    'options'=>['class'=>'uk-child-width-1-2@m uk-form-small uk-grid-match'],
    'fieldConfig' => [
        'width' => "1-3@m"
    ],
]);

$form->field($model,'attribute',['width'=>'auto@m']);

$form->field($model,'attribute')->label('label')->info('Additional info to the label of this field');

$form->field($model,'attribute')->icon('lock');

$form->field($model,'attribute')->icon('<i class="fas fa-user"></i>',['flip'=>true,'uikit'=>false,'tag'=>'a','href'=>'http://example.com']);

echo Alert::widget([
  'type'=>'primary',
  'body' => 'Say hello...',
]);

Alert::begin([
  'type' => 'warning',
  'closeButton'=>false,
]);

echo 'Say hello...';

Alert::end();