PHP code example of iamok / yii2-metronic

1. Go to this page and download the library: Download iamok/yii2-metronic library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

iamok / yii2-metronic example snippets


'components' => [
    'metronic'=>[
        'class'=>'iamok\metronic\Metronic',
        'resources'=>'[path to my web]/web/metronic/assets/theme/assets',
        'style'=>\iamok\metronic\Metronic::STYLE_MATERIAL,
        'theme'=>\iamok\metronic\Metronic::THEME_LIGHT,
        'layoutOption'=>\iamok\metronic\Metronic::LAYOUT_FLUID,
        'headerOption'=>\iamok\metronic\Metronic::HEADER_FIXED,
        'sidebarPosition'=>\iamok\metronic\Metronic::SIDEBAR_POSITION_LEFT,
        'sidebarOption'=>\iamok\metronic\Metronic::SIDEBAR_MENU_ACCORDION,
        'footerOption'=>\iamok\metronic\Metronic::FOOTER_FIXED,

    ],
]

'assetManager' => [
        'linkAssets' => true,
        'bundles' => [
            'yii\web\JqueryAsset' => [
                'sourcePath' => null,   // do not publish the bundle
                'js' => [
                    '//code.jquery.com/jquery-1.11.2.min.js',  // use custom jquery
                ]
            ],
            
            'iamok\metronic\bundles\ThemeAsset' => [
                'addons'=>[
                    'default/login'=>[
                        'css'=>[
                            'pages/css/login-4.min.css',
                        ],
                        'js'=>[
                            'global/plugins/backstretch/jquery.backstretch.min.js',

                        ]
                    ],
                ]
            ],
        ],
    ],



/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use iamok\metronic\helpers\Layout;
use iamok\metronic\Metronic;

$asset = Metronic::registerThemeAsset($this);

$directoryAsset = Yii::$app->assetManager->getPublishedUrl($asset->sourcePath);


Yii::$classMap['yii\helpers\Html'] = '@vendor/iamok/yii2-metronic/helpers/Html.php';



// comment out the following two lines when deployed to production
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

tion($config))->run();
config/web.php
views/layout/main.php
config/bootstrap.php
web/index.php