定制 anli/yii2-metronic 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

anli/yii2-metronic

最新稳定版本:2.0.0

Composer 安装命令:

composer require anli/yii2-metronic

包简介

Yii 2.0 Metronic Theme

README 文档

README

Yii 2.0 Metronic Theme

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist anli/yii2-metronic "*"

or add

"anli/yii2-metronic": "*"

to the require section of your composer.json file.

Download the latest metronic files and copy the contents in the theme folder to @web/metronic/theme/.

Copy the contents of the js folder to the @web/metronic/js/ folder.

Copy the contents of the images folder to the @web/images/ folder.

Add to the module section in your config.php

'metronic' => [
    'class' => 'anli\metronic\Module',
    'headerPath' => '@app/views/layouts/metronic/_header',
    'sidebarPath' => '@app/views/layouts/metronic/_sidebar',
    'footerPath' => '@app/views/layouts/metronic/_footer',
],

Usage

Add to the view file with:

Yii::$app->controller->layout = '@vendor/anli/yii2-metronic/views/layouts/main';

Add to the controller or module file:

/**
 * @inheritdoc
 */
public $layout = '@vendor/anli/yii2-metronic/views/layouts/main';

Profile widget

use anli\metronic\widgets\Profile;
...

<?php Profile::begin([
    'imageUrl' => 'https://s.gravatar.com/avatar/ecd2a5b6d5a2d17e7bd9169b6f12515b?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fjo.png',
    'title' => Html::encode($this->title),
    'caption' => 'This is a caption',
    'buttons' => [
        Html::a('<i class="fa fa-pencil"></i>', false, ['value' => Url::to(["$controllerUrlName/update", 'id' => $model->id]), 'data-toggle' => 'tooltip', 'title' => "Update", 'class' => 'showModalButton btn btn-circle green-haze btn-sm', 'accesskey' => '']),
    ],
    'statItems' => [
        ['title' => 74, 'caption' => 'Caption for 74'],
        ['title' => 23, 'caption' => 'Caption for 23'],
    ],
    'menuItems' => [
        ['label' => 'Link 1', 'url' => ['site/index']],
        ['label' => 'Link 2', 'url' => ['site/index']],
    ],
    'summary' => [
        'title' => 'This is a title',
        'caption' => 'This is a caption',
        'items' => [
            '<a>item A</a>',
            '<a>item B</a>',
            '<a>item C</a>',
        ],
    ],
]); ?>
...
<?php Profile::end(); ?>

Portlet Widget

Add to your view file with:

use anli\metronic\widgets\Portlet;
...

Body Widget

<?php anli\metronic\widgets\Body::begin(); ?>
...
<?= $content ?>
...
<?php anli\metronic\widgets\Body::end(); ?>

Header Widget

<?= anli\metronic\widgets\Header::widget([
    'items' => [
        Html::a('<i class="icon-share-alt"></i> Change Tenant </a>',  false, ['value' => '', 'class' => 'showModalButton']),
        Html::a('<i class="icon-key"></i> Log Out </a>', '', ['data-method' => 'post']),
    ]
]); ?>

统计信息

  • 总下载量: 307
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-12