Use 3.x tags for yii >= 2.0.13
Use 2.x tags for yii < 2.0.13
See http://almsaeedstudio.com/themes/AdminLTE/pages/widgets.html and http://almsaeedstudio.com/themes/AdminLTE/pages/UI/general.html examples
Independent of any AdminLte AssetBundles If you want use cookie collapsing boxes, set correct dependencies in AssetManager
'components'=>[
//--------
'assetManager'=>[
'class'=>'yii\web\AssetManager',
'bundles'=>[
//--------
'insolita\wgadminlte\JsCookieAsset'=>[
'depends'=>[
'yii\web\YiiAsset',
'namespace\for\AdminLteAsset', // for example 'dmstr\web\AdminLteAsset', if we use https://github.com/dmstr/yii2-adminlte-asset
]
],
'insolita\wgadminlte\CollapseBoxAsset'=>[
'depends'=>[
'insolita\wgadminlte\JsCookieAsset'
]
],
],
]
//--------
]
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist insolita/yii2-adminlte-widgets "^3.2"
or add
"insolita/yii2-adminlte-widgets": "^3.2"
to the "require" section of your composer.json
file.
<?php \insolita\wgadminlte\LteBox::begin([
'type'=>\insolita\wgadminlte\LteConst::TYPE_INFO,
'isSolid'=>true,
'boxTools'=>'<button class="btn btn-success btn-xs create_button" ><i class="fa fa-plus-circle"></i> Add</button>',
'tooltip'=>'this tooltip description',
'title'=>'Manage users',
'footer'=>'total 44 active users',
])?>
ANY BOX CONTENT HERE
<?php \insolita\wgadminlte\LteBox::end()?>
<?php \insolita\wgadminlte\LteBox::begin([
'type'=>\insolita\wgadminlte\LteConst::COLOR_MAROON,
'tooltip'=>'Useful information!',
'title'=>'Attention!',
'isTile'=>true
])?>
ANY BOX CONTENT HERE
<?php \insolita\wgadminlte\LteBox::end()?>
Box with content as property
<?php \insolita\wgadminlte\LteBox::widget([
'type'=>\insolita\wgadminlte\LteConst::COLOR_MAROON,
'tooltip'=>'Useful information!',
'title'=>'Attention!',
'isTile'=>true,
'body'=>'Some Box content'
])?>
CollapseBox (Based on LteBox)
<?php \insolita\wgadminlte\CollapseBox::begin([
'type'=>\insolita\wgadminlte\LteConst::TYPE_INFO,
'collapseRemember' => true,
'collapseDefault' => false,
'isSolid'=>true,
'boxTools'=>'<button class="btn btn-success btn-xs create_button" ><i class="fa fa-plus-circle"></i> Добавить</button>',
'tooltip'=>'Описание содаржимого',
'title'=>'Управление пользователями',
])?>
ANY BOX CONTENT HERE
<?php \insolita\wgadminlte\CollapseBox::end()?>
SmallBox
<?php echo \insolita\wgadminlte\LteSmallBox::widget([
'type'=>\insolita\wgadminlte\LteConst::COLOR_LIGHT_BLUE,
'title'=>'90%',
'text'=>'Free Space',
'icon'=>'fa fa-cloud-download',
'footer'=>'See All <i class="fa fa-hand-o-right"></i>',
'link'=>Url::to("/user/list")
]);?>
InfoBox
<?php echo \insolita\wgadminlte\LteInfoBox::widget([
'bgIconColor'=>\insolita\wgadminlte\LteConst::COLOR_AQUA,
'bgColor'=>'',
'number'=>100500,
'text'=>'Test Three',
'icon'=>'fa fa-bolt',
'showProgress'=>true,
'progressNumber'=>66,
'description'=>'Something about this'
])?>
Callout
<?php \insolita\wgadminlte\Callout::widget([
'type'=>\insolita\wgadminlte\LteConst::TYPE_WARNING,
'head'=>'Operation Complete',
'text'=>'Something text bla-bla-bla bla-bla-blabla-bla-blabla-bla-blabla-bla-blabla-bla-blabla-bla-bla'
]);?>
<?php \insolita\wgadminlte\Callout::begin([
'type'=>\insolita\wgadminlte\LteConst::TYPE_WARNING,
'head'=>'Operation Complete'
]);?>
<?php \insolita\wgadminlte\Callout::end()?>
* Alert
```php
<?=\insolita\wgadminlte\Alert::widget([
'type'=>\insolita\wgadminlte\LteConst::TYPE_SUCCESS,
'text'=>'Operation Complete',
'closable'=>true
]);?>
<?php
\insolita\wgadminlte\Alert::begin([
'type'=>\insolita\wgadminlte\LteConst::TYPE_SUCCESS,
'closable'=>true
]);?>
Some alert message
<?php \insolita\wgadminlte\Alert::end()?>
Add in layout
<?= \insolita\wgadminlte\FlashAlerts::widget([
'errorIcon' => '<i class="fa fa-warning"></i>',
'successIcon' => '<i class="fa fa-check"></i>',
'successTitle' => 'Done!', //for non-titled type like 'success-first'
'closable' => true,
'encode' => false,
'bold' => false,
]); ?>
And set flash messages anywhere
Yii::$app->session->setFlash('info1','Message1');
Yii::$app->session->setFlash('info2','Message2');
Yii::$app->session->setFlash('info3','Message3');
Yii::$app->session->setFlash('success-first','Message');
Yii::$app->session->setFlash('success-second','Message');
Since 2.0
<?php
\insolita\wgadminlte\LteChatBox::begin([
'type' => \insolita\wgadminlte\LteConst::TYPE_PRIMARY,
'footer'=>'<input type="text" name="newMessage">',
'title'=>'Messages',
'boxTools' => '<button class="btn btn-xs"><i class="fa fa-refresh"></i></button>'
]);
echo \insolita\wgadminlte\LteChatMessage::widget([
'isRight' => false,
'author' => 'Artur Green',
'message' => 'Some message bla-bla',
'image'=>'https://almsaeedstudio.com/themes/AdminLTE/dist/img/user3-128x128.jpg',
'createdAt' => '5 minutes ago'
]);
echo \insolita\wgadminlte\LteChatMessage::widget([
'isRight' => true,
'author' => 'Jane Smith',
'message' => 'Some message bla-bla',
'image'=>'https://almsaeedstudio.com/themes/AdminLTE/dist/img/user1-128x128.jpg',
'createdAt' => '2017-23-03 17:33'
]);
\insolita\wgadminlte\LteChatBox::end();
?>
Widget for configure lte settings
Add in layout
<?php
\insolita\wgadminlte\LteSetup::widget([
'animationSpeed' => 'fast',
'enableFastclick' => false,
'navbarMenuSlimscroll'=>false
//etc...
]);
?>
v3.2.3
07.05.2021 v.3.2.2
v.3.2.1
v.3.2
16.05.2018 v3.1.1
04.11.2017 v3.0
Remove deprecated classes
06.01.2018 v2s.1
26.03.2017 v2.0 Replaced: abandoned jquery-cookie library has been replaced with js-cookie (official replacement)
Add LteSetupWidget
03.06.2016 v 1.1.6 Fix FlashAlerts; support flashes added as array via Yii::$app->session->addFlash
19.05.2016 v 1.1.5 change composer jquery-cookie version, fix JCookieAsset path
25.09.2015 v1.1.2 Fix collapse remember functional for Box and Tiles, add new options for Box and Tile "collapseDefault" - if true, box will be collapsed by default
13.03.2015 v1.1.1 new Info-Box widget for AdminLte 2.0 add with-border options to Box widget for AdminLte 2.0 add ability to set left and right toolbar elements for box widget not only as string html code but also as array for yii\bootstrap\ButtonGroup $buttons
07.03.2015 v1.1.0 Remove dependency of common\assets\AdminLTE (previous variant branched to stkit)
14.02.2015 Added: FlashAlerts Widget - widget for layout for show Yii flash messages in lte style and support multiple message in one style
Comments