anli/yii2-metronic Yii 2.0 Metronic Theme

extension

anli\metronic

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']),
    ]
]); ?>

Changelog

CHANGELOG

2.0.0 [27 Jan 2016]

  • chg Refactored body and header widget
  • enh Added documentation on body and header widget
  • enh Added sidebar widget
  • enh Added footer and sidebar, header, footer methods into body
  • enh Added tooltip js and search widget
  • enh Added dropdown widbget
  • chg Renamed modal to modal button
  • chg Updated widget for layout
  • enh Added url route to include query params
  • chg Updated minor changes to portlet
  • bug Fixed bug on search not working in module
  • bug Fixed bug with reset url
  • bug Fixed bug on profile on stats css not rendering correctly
  • chg Updated modal js

1.7.0 [19 Sep 2015]

  • chg Removed js script in profile assets
  • chg Changed portlet and gridview widget
  • enh Added profile widget

1.6.0 [17 Sep 2015]

  • enh Added setting link to header
  • enh Added profile widget

1.5.0 [7 Sep 2015]

  • enh Added modal form only close-able by clicking cross or submitting form

1.4.1 [3 Sep 2015]

  • bug Fixed namespace for error assets in error layout

1.4.0 [3 Sep 2015]

  • enh Added error layout

1.3.0 [2 Sep 2015]

  • enh Added change tenant link to layout

1.2.0 [1 Sep 2015]

  • enh Refactor modal in main layout

1.1.0 [28 Aug 2015]

  • enh Added alert block widget
  • enh Added sidebar to get from view params
  • chg Changed gridview assets to widget
  • enh Added tooltip assets

1.0.0 [19 Aug 2015]

  • enh Added yii2 extension files
  • enh Added assets, gridview, navbar portlet widgets and js
  • enh Added main layout and images for gif loader
  • enh Added login layout
  • chg Changed the model size to medium
  • enh Added in PjaxAsset in main layout
  • enh Added button group feature and gridview asset

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



2.0.0 is the latest of 10 releases



MIT license
Stats
5 github stars & 1 github forks
0 downloads in the last day
1 downloads in the last 30 days
307 total downloads