2017 © Pedro Peláez
 

yii2-extension yii2-uikit

Uikit for Yii2

image

worstinme/yii2-uikit

Uikit for Yii2

  • Wednesday, January 17, 2018
  • by worstinme
  • Repository
  • 3 Watchers
  • 3 Stars
  • 1,326 Installations
  • CSS
  • 4 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 12 Versions
  • 2 % Grown

The README.md

Uikit 3 extensions for Yii2

Widgets & assets for a lightweight and modular front-end framework UiKit, (*1)

Installation of yii2-uikit Extension

The preferred way to install this extension is through composer. You have to set in your project's composer.json to use this package, because of Uikit 3 RC version., (*2)

"minimum-stability": "dev",
"prefer-stable":true,

After this settings, just run:, (*3)

composer require --prefer-dist worstinme/yii2-uikit:"dev-master"

or add, (*4)

"worstinme/yii2-uikit": "dev-master"

to the require section of your composer.json file and start composer update, (*5)

Assets usage exaple:

For example, including main UiKit css & js files in any view files, (*6)

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

ActiveForm improvements examples:

Horizontal layout for ActiveForm, (*7)

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

To get a column layout in grid mode you can modify those options, (*8)

$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"
    ],
]);

Different options for single field, (*9)

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

ActiveField additional methods:

The code below will generate question icon (?), placed after label text, with information showed with uk-tooltip, (*10)

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

This will generate <i uk-icon="lock"></i> inside input field wrapped by div.uk-inline, (*11)

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

Icon can be placed in the right side of input field or changed to non uikit icon by this settings, (*12)

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

Alert widgets:

Alert renders an alert uikit component., (*13)

For example,, (*14)

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

The following example will show the content enclosed between the [[begin()]] and [[end()]] calls within the alert box:, (*15)

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

echo 'Say hello...';

Alert::end();

And the AlertFlashes widget to automatically call alert widgets for existing flash messages stored in session, (*16)

\worstinme\uikit\extend\AlertFlashes::widget();

The Versions

17/01 2018

dev-master

9999999-dev

Uikit for Yii2

  Sources   Download

MIT

The Requires

 

yii2 widgets uikit

15/08 2017

1.2.11

1.2.11.0

Uikit for Yii2

  Sources   Download

MIT

The Requires

 

yii2 widgets uikit

24/07 2017

1.2.10

1.2.10.0

Uikit for Yii2

  Sources   Download

MIT

The Requires

 

yii2 widgets uikit

23/02 2017

1.2.9

1.2.9.0

Uikit for Yii2

  Sources   Download

MIT

The Requires

 

yii2 widgets uikit

22/02 2017

1.2.4

1.2.4.0

Uikit for Yii2

  Sources   Download

MIT

The Requires

 

yii2 widgets uikit

22/02 2017

1.2.3

1.2.3.0

Uikit for Yii2

  Sources   Download

MIT

The Requires

 

yii2 widgets uikit

10/05 2016

1.1.1

1.1.1.0

Uikit for Yii2

  Sources   Download

MIT

The Requires

 

yii2 widgets uikit

24/04 2016

1.1.0

1.1.0.0

Uikit for Yii2

  Sources   Download

MIT

The Requires

 

yii2 widgets uikit

23/04 2016

1.0.11

1.0.11.0

Uikit for Yii2

  Sources   Download

MIT

The Requires

 

yii2 widgets uikit

31/03 2016

1.0.10

1.0.10.0

Uikit for Yii2

  Sources   Download

MIT

The Requires

 

yii2 widgets uikit

31/03 2016

1.0.9

1.0.9.0

Uikit for Yii2

  Sources   Download

MIT

The Requires

 

yii2 widgets uikit

26/11 2015

1.0.8

1.0.8.0

Uikit for Yii2

  Sources   Download

MIT

The Requires

 

yii2 widgets uikit