Yii 2.0 Metronic Theme
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',
],
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';
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(); ?>
Add to your view file with:
use anli\metronic\widgets\Portlet;
...
<?php anli\metronic\widgets\Body::begin(); ?>
...
<?= $content ?>
...
<?php anli\metronic\widgets\Body::end(); ?>
<?= 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']),
]
]); ?>
chg
Refactored body and header widgetenh
Added documentation on body and header widgetenh
Added sidebar widgetenh
Added footer and sidebar, header, footer methods into bodyenh
Added tooltip js and search widgetenh
Added dropdown widbgetchg
Renamed modal to modal buttonchg
Updated widget for layoutenh
Added url route to include query paramschg
Updated minor changes to portletbug
Fixed bug on search not working in modulebug
Fixed bug with reset urlbug
Fixed bug on profile on stats css not rendering correctlychg
Updated modal jschg
Removed js script in profile assetschg
Changed portlet and gridview widgetenh
Added profile widgetenh
Added setting link to headerenh
Added profile widgetenh
Added modal form only close-able by clicking cross or submitting formbug
Fixed namespace for error assets in error layoutenh
Added error layoutenh
Added change tenant link to layoutenh
Refactor modal in main layoutenh
Added alert block widgetenh
Added sidebar to get from view paramschg
Changed gridview assets to widgetenh
Added tooltip assetsenh
Added yii2 extension filesenh
Added assets, gridview, navbar portlet widgets and jsenh
Added main layout and images for gif loaderenh
Added login layoutchg
Changed the model size to mediumenh
Added in PjaxAsset in main layoutenh
Added button group feature and gridview asset
Comments