Skip to content
Asset for Remark Admin Theme
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
views/layouts
web
README.md
composer.json

README.md

Remark Asset Bundle

Backend UI for Yii2 Framework, based on Remark

This package contains an Asset Bundle for Yii 2.0 Framework which registers the required JS and CSS files for the Remark theme.

I've taken inspiration from AdminLTE Yii2 Extension

This extension is still work in progress

Installation

The preferred way to install this extension is through composer.

To install Remark Asset run:

php composer.phar require d4rkstar/yii2-remark-asset "2.0.x-dev"

You've to unzip the contents of your remark theme inside the @webroot/remark folder. Check Aliases.

You should have a folder structure like this:

  • app/
    • web/
      • remark/
        • base/
        • global/
        • iconbar/
        • mmenu/
        • topbar/

Quick Start

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

For Yii 2 Application Template or Basic Application Template

Edit your config/web.php and add:

'components' => [
    'view' => [
         'theme' => [
             'pathMap' => [
                '@app/views' => '@vendor/d4rkstar/yii2-remark-asset/views'
             ],
         ],
    ],
],

Then change these in your configuration:

'components' => [
    'assetManager' => [
         'bundles' => [
              'd4rkstar\web\RemarkAsset' => [
                'skin' => 'orange',
              ],
              'yii\web\JqueryAsset' => [
                'sourcePath' => null,
                'js' => [
                    '//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js',
                ]
              ],
         ],
    ],
],

To speedup asset creation you may eventually you may use symlinking:

'components' => [
    'assetManager' => [
        'linkAssets' => true, // create symlinks
        'bundles' => [
            ...
         ],
    ],
],

You may add custom css / js for specific controller/action using the "addons" attribute.

'components' => [
    'assetManager' => [
        'linkAssets' => true, // create symlinks
        'bundles' => [
            'd4rkstar\web\RemarkAsset' => [
                // 'skin' => 'orange',
                'addons'=>[
                    // SiteController, actionLogin
                    'site/login'=>[
                        'css'=>[
                            'base/assets/examples/css/pages/login-v3.css'
                        ],
                        'js'=>[
                            'global/js/components/material.js'
                        ]
                    ]
                ]
            ],
         ],
    ],
],

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.

Therefore it is recommended to copy the views into your application and adjust them to your needs.

You can’t perform that action at this time.