jcabanillas/yii2-inspinia

Inspinia 2.5 小部件

安装次数: 1,174

依赖项: 0

建议者: 0

安全: 0

星标: 7

关注者: 3

分支: 8

开放性问题: 1

语言:JavaScript

类型:yii2-extension

dev-master 2016-06-10 06:34 UTC

This package is auto-updated.

Last update: 2024-09-08 05:27:03 UTC


README

Inspinia 2.5 小部件真正可用

购买此主题的许可证 https://wrapbootstrap.com/theme/inspinia-responsive-admin-theme-WB0R5L90S

安装

首选的安装方式是通过 composer

运行以下命令之一

php composer.phar require --prefer-dist jcabanillas/yii2-inspinia "*"

或在您的 composer.json 文件的 require 部分添加以下内容

"jcabanillas/yii2-inspinia-asset": "*"

快速开始

一旦安装了扩展,您可以通过重新配置视图组件的路径映射来预览它

对于 Yii 2 应用程序模板或基本应用程序模板

'components' => [
    'view' => [
         'theme' => [
             'pathMap' => [
                '@app/views' => '@vendor/jcabanillas/yii2-inspinia/views'
             ],
         ],
    ],
],

此资产包提供了布局和视图的示例文件,它们不打算直接在 vendor/ 文件夹中自定义。

因此建议将视图复制到您的应用程序中,并调整以满足您的需求。

自定义

Copy files from vendor/jcabanillas/yii2-inspinia/views to @app/views.
Remove the custom view configuration from your application by deleting the path mappings, if you have made them before.

组件

页眉块和面包屑导航

结构

<div class="col-sm-12">
    <h2>Title</h2>

    <?=Breadcrumbs::widget([
        'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
    ]) ?>
</div>

要更改它,使用以下方法

<?php $this->beginBlock('content-header'); ?>
About <small>static page</small>
<?php $this->endBlock(); ?>

添加此块并使用页眉右侧工具栏

<?php $this->beginBlock('content-header-actions'); ?>
<a href="<?=Url::to(['create'])?>" class="btn btn-primary">
    <i class="fa fa-fw fa-plus"></i>
    <?=\Yii::t('reference', 'Create filial')?>
</a>
<?php $this->endBlock(); ?>

中间框

<div class="middle-box text-center animated fadeInRightBig">
    <h3 class="font-bold">This is page content</h3>
    <div class="error-desc">
        You can create here any grid layout you want. And any variation layout you imagine:) Check out
        main dashboard and other site. It use many different layout.
        <br/><a href="index-2.html" class="btn btn-primary m-t">Dashboard</a>
    </div>
</div>

面板

用法

<?php Panel::begin([
    'title'=>$this->title,
    'description'=> 'same text',
    'toolbar'=>[
        ...
    ]
])?>

    <?php echo GridView::widget([
        'dataProvider' => $dataProvider,
        'tableOptions' => ['class' => 'table table-hover']
    ]); ?>
    
<?php Panel::end()?>

配置:标题 - 面板标题;描述 - 面板描述(标题右侧);页脚 - 页脚文本

工具栏 - 面板菜单示例

'toolbar'=>[
        [
            'title' => '',
            'link'  => Url::to(['/']),
            'icon'  => 'wrench',
            'items' => [
                [
                    'title' => 'Item 1',
                    'link'  => Url::to(['/']),
                    'icon'  => 'earth',
                ],
                [
                    'title' => 'Item 2',
                    'link'  => Url::to(['/']),
                    'icon'  => 'pencil',
                ],
            ],
        ],
        [
            'title' => '',
            'link'  => Url::to(['http://vk.com']),
            'icon'  => 'vk',
        ]
    ]

折叠按钮 true 如果面板可折叠;关闭按钮 true 如果面板可关闭

ionRangeSlider 小部件

<?= $form->field($model, 'work_time')->widget(\jcabanillas\inspinia\widgets\ionRangeSlider::className(), [
    'clientOptions'=>[
        'type'=>'double',
        'grid'=>true,
        'min'=>0,
        'max'=>'24',
        'from'=>10,
        'to'=>18,
        'step'=>'.01',
        'prefix'=> \Yii::t('reference', 'Worktime:'),
        'decorate_both'=> false,
        'values_separator'=>  ' '.\Yii::t('reference', 'to').' ',
    ]
]) ?>