d4rkstar/yii2-remark-asset

Backend theme for Yii2 Framework

Installs: 261

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master / 2.0.x-dev 2015-11-17 22:17 UTC

This package is auto-updated.

Last update: 2024-04-12 09:46:45 UTC


README

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.