yii2-bootswatch-asset Brings Bootswatch to Yii2

  1. Installation
  2. Usage
  3. Resources
  4. Changes

Ever wanted a nice design based on Bootstrap for your web pages ? .. and of course, with minimal effort ?

Well, yii2-bootswatch-asset is just what you need, an Asset bunlde around the Bootswatch theme suite. Visit Bootswatch for more.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist raoul2000/yii2-bootswatch-asset "*"

or add

"raoul2000/yii2-bootswatch-asset": "*"

to the require section of your composer.json file.

Usage

To use a bootswatch theme in your Yii2 application, add the BootswatchAsset bundle to your main AppAsset bundle:

// ./assets/AppAsset.php

class AppAsset extends AssetBundle
{
    public $depends = [
        'yii\web\YiiAsset',
        // let's add the BootswatchAsset here
    	'raoul2000\bootswatch\BootswatchAsset',
    ];
}
?>

Then at some point you must select the theme name you want to use. In the example below, the theme 'cosmo' is set in the main layout.

// ./views/layouts/main.php

raoul2000\bootswatch\BootswatchAsset::$theme = 'cosmo';
AppAsset::register($this);

For more information on the plugin options, please refer to yii2-bootswatch-asset@github.

Resources

Changes

version 1.2.7
  • update to bootswatch 3.3.7
version 1.2.6
  • update to bootswatch 3.3.6+1
version 1.2.5
version 1.2.4
  • update to bootswatch 3.3.5
version 1.2.3
  • update to bootswatch 3.3.4
version 1.2.2
  • fix : publish woff2 font "glyphicons-halflings-regular.woff2" (thanks to jwerner)
version 1.2.1
  • update dependency : thomaspark/bootswatch version 3.3.2 after bootstrap 3.3.2 has been release
version 1.2.0
  • update dependency : thomaspark/bootswatch version 3.3.1 in order to include latest bootswatch themes (journal, sandstone).
version 1.1.1

-fix : minified CSS was not correctly handled. Now, if YII_ENV_DEV is defined bootstrap.css is published, otherwise bootstrap.min.css is used

version 1.1.0
  • fix : gylphicons not accessible.
  • enh : optimize publication process. When no theme is set, no publication is performed.
  • enh : no theme is selected by default.
version 0.0.0
  • Initial release
3 0
11 followers
0 downloads
Yii Version: 2.0
License: BSD-2-Clause
Category: User Interface
Developed by: Raoul
Created on: Sep 29, 2014
Last updated: a year ago

Related Extensions