2017 © Pedro Peláez
 

yii2-extension yii2-materialadmin-asset

Assets for using Material Admin Theme in Yii2 Framework

image

rrmontuan/yii2-materialadmin-asset

Assets for using Material Admin Theme in Yii2 Framework

  • Tuesday, May 22, 2018
  • by rrmontuan
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 80 % Grown

The README.md

yii2-materialadmin-asset

Assets for using Material Admin Theme in Yii2 Framework, (*1)

Latest Stable Version Total Downloads License, (*2)

Backend UI for Yii2 Framework, based on Material Admin The Material Admin Template isn't free and must be purchased before using., (*3)

"Yii2 AdminLTE Presentation", (*4)

This package contains an Asset Bundle for Yii 2.0 Framework which registers the CSS files for the Material Admin user-interface., (*5)

The CSS files are installed via Yii's recommended usage of the fxp/composer-asset-plugin v1.1.1 or later., (*6)

Installation

The preferred way to install this extension is through composer., (*7)

To install the Material Admin Asset run:, (*8)

composer require rrmontuan/yii2-materialadmin-asset "^1.0"

Quick Start

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

For Yii 2 Advanced Application Template or Basic Application Template, (*10)

'components' => [
    'view' => [
         'theme' => [
             'pathMap' => [
                '@app/views' => '@vendor/rrmontuan/yii2-materialadmin-asset/example-views/yiisoft/yii2-app'
             ],
         ],
    ],
],

The Material Admin Asset uses the sourcePath @templates/materialadmin as default. However,if you want (or need) you can change the sourcePath reconfiguring as showed below:, (*11)

'components' => [
    'assetManager' => [
        'bundles' => [
            'rrmontuan\web\MaterialAdminAsset' => [
                'sourcePath' => '@app\myfolder'
            ],
        ],
    ],
],

This asset bundle provides sample files for layout and view (see folder examples/), they are not meant to be customized directly in the vendor/ folder., (*12)

Therefore it is recommended to copy the views into your application and adjust them to your needs., (*13)

Customization

  • Copy files from vendor/rrmontuan/yii2-materialadmin-asset/example-views/yiisoft/yii2-app (or other theme) to @app/views.
  • Remove the custom view configuration from your application by deleting the path mappings, if you have made them before.

Material Admin Plugins

Assets for Material Admin Plugins are not included in our MaterialAdminAsset but you can find all the files in the folder vendors inside the Material Admin Template folder . So if you want to use any of them we recommend to create a custom bundle where you list the plugin files you need:, (*14)

use yii\web\AssetBundle;
class MaterialAdminPluginAsset extends AssetBundle
{
    public $sourcePath = '@app/templates/materialadmin';
    public $js = [
        // more plugin Js here
    ];
    public $css = [
        // more plugin CSS here
    ];
    public $depends = [
        'rrmontuan\web\MaterialAdminAsset',
    ];
}

As this asset depends on our AdminLteAsset it's the only asset you have to register, for example in your main.php layout file., (*15)

If you need to add more itens to the menu you can do this way:, (*16)

'items'=>[
    [
        'label' => 'Dashboards Slideshow',
        'icon' => 'now-widgets',
        'url' => ['/site/about'],
        'visible' => true
    ],
    [
        'label' => 'Tables',
        'icon' => 'view-list',
        'url' => ['/site'],
        'items' => [
            ['label' => 'Normal Tables', 'url' => ['/site/contact'],],
            ['label' => 'Data Tables', 'url' => ['/site/index'],],
        ],
    ],
]

By default to icons will be added prefix of Material Design Icons, (*17)

Template for Gii CRUD generator

Tell Gii about our template. The setting is made in the config file:, (*18)

if (YII_ENV_DEV) {    
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',      
        'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*', '192.168.178.20'],  
        'generators' => [ //here
            'crud' => [
                'class' => 'yii\gii\generators\crud\Generator',
                'templates' => [
                    'materialadmin' => '@vendor/rrmontuan/yii2-materialadmin-asset/gii/templates/crud/simple',
                ]
            ]
        ],
    ];
}

The Versions

22/05 2018

v1.0.2

1.0.2.0

Assets for using Material Admin Theme in Yii2 Framework

  Sources   Download

BSD-3-Clause

by Ricardo Montuan

css extension yii2 asset backend theme admin materialadmin

19/04 2018

dev-master

9999999-dev

Assets for using Material Admin Theme in Yii2 Framework

  Sources   Download

BSD-3-Clause

by Ricardo Montuan

css extension yii2 asset backend theme admin materialadmin

19/04 2018

v1.0.1

1.0.1.0

Assets for using Material Admin Theme in Yii2 Framework

  Sources   Download

BSD-3-Clause

by Ricardo Montuan

css extension yii2 asset backend theme admin materialadmin

17/04 2018

v1.0.0

1.0.0.0

Assets for using Material Admin Theme in Yii2 Framework

  Sources   Download

BSD-3-Clause

by Ricardo Montuan

css extension yii2 asset backend theme admin materialadmin