PHPackages                             irrahub/yii2-material-assets - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. irrahub/yii2-material-assets

ActiveYii2-extension

irrahub/yii2-material-assets
============================

Material Ui template for yii2

012CSS

Since Sep 3Pushed 7y agoCompare

[ Source](https://github.com/testingforsomeone/yii2-material-assets)[ Packagist](https://packagist.org/packages/irrahub/yii2-material-assets)[ RSS](/packages/irrahub-yii2-material-assets/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Yii2 Material Assets
====================

[](#yii2-material-assets)

*Material UI for Yii2 Framework, based on [Creative Tim Material Dashboard](https://www.creative-tim.com/product/material-dashboard)*

[!["CT material dashboard"](https://camo.githubusercontent.com/0524b3b373443c8d16c021d3acbcf26c6a1c1dbbd55cce5c087481e9d90d57f7/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f637265617469766574696d5f6275636b65742f70726f64756374732f35302f6f726967696e616c2f6f70745f6d645f7468756d626e61696c2e6a70673f31353232323332363435)](https://camo.githubusercontent.com/0524b3b373443c8d16c021d3acbcf26c6a1c1dbbd55cce5c087481e9d90d57f7/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f637265617469766574696d5f6275636b65742f70726f64756374732f35302f6f726967696e616c2f6f70745f6d645f7468756d626e61696c2e6a70673f31353232323332363435)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer require irrahub/yii2-material-assets

```

or add

```
"spl/yii2-material-assets": "*"

```

to the require section of your `composer.json` file.

Quick Start
-----------

[](#quick-start)

Once the extension is installed, you can have a **preview** by reconfiguring the path mappings of the view component:

```
'components' => [
    'view' => [
        'theme' => [
            'pathMap' => [
                '@app/views' => '@vendor/spl/yii2-material-template/template/material-dashboard/view'
            ],
        ],
    ],
],
```

> Don't forget to remove `'yii\bootstrap\BootstrapAsset'` and `'yii\bootstrap\BootstrapPluginAsset'` from `common\asset\AppAsset`(advence) or `app\asset\AppAsset`(basic)

Customization
-------------

[](#customization)

- Copy files from `vendor/spl/yii2-material-template/template/material-dashboard/view`
- Remove the custom `view` configuration from your application by deleting the path mappings, if you have made them before.

---

### Web-font usage

[](#web-font-usage)

Copy-paste the stylesheet into your before all other stylesheets to load the Fonts and Icons.

```

```

---

### Config template

[](#config-template)

Default config.

```
[
    'siteTitle' = 'Material Dashboard',
    'sidebarColor' => 'rose', // "purple | azure | green | orange | danger | rose"
    'sidebarBackgroundColor' => 'black', // "black | white"
    'sidebarBackgroundImage' => 'template/material-dashboard/img/sidebar-1.jpg'
]
```

You can change it in config file.

```
'components' => [
    'assetManager' => [
        'bundles' => [
            'spl\web\MaterialDashboardAsset' => [
		'siteTitle' = 'Your Site Name',
                'sidebarColor' => 'rose',
                'sidebarBackgroundColor' => 'black',
		'sidebarBackgroundImage' => 'img url'
            ],
        ],
    ],
],
```

or

using bundled assets

```
    Yii::$container->set(
        MaterialDashboardAsset::className(),
        [
	    'siteTitle' = 'Your Site Name',
	    'sidebarColor' => 'rose',
	    'sidebarBackgroundColor' => 'black',
	    'sidebarBackgroundImage' => 'img url'
        ]
    );
```

---

### Sidebar menu - Widget Menu

[](#sidebar-menu---widget-menu)

```
        $menu = SPLmenu::widget(
            [
                'items' => [
                    ['label' => 'Dashboard', 'icon' => 'dashboard', 'url' => ['/site/index']],
                    [
                        'label' => 'Multi Level Collapse',
                        'icon' => 'swap_vertical_circle',
                        'url' => '#',
                        'items' => [
                            ['label' => 'Level One', 'url' => '#',],
                            [
                                'label' => 'Level Two',
                                'icon' => 'swap_vertical_circle',
                                'url' => '#',
                                'items' => [
                                    ['label' => 'Level Three', 'url' => '#',],
                                    ['label' => 'Level Three', 'url' => '#',],
                                ],
                            ],
                        ],
                    ],
                    [
                        'label' => 'Some tools',
                        'icon' => 'build',
                        'url' => '#',
                        'items' => [
                            ['label' => 'Gii', 'icon' => 'settings_input_composite', 'url' => ['/gii'],],
                            ['label' => 'Debug', 'icon' => 'bug_report', 'url' => ['/debug'],],
                        ],
                    ],
                ],
            ]
        );
```

create menu.php in `common\models`(advence) or `app\models`(basic) if you configuring the path mappings of the view component

example:

```
