dalencar / yii2-webfontkit
Set of icon frameworks for use in Yii Framework 2.0
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
This package is not auto-updated.
Last update: 2024-11-09 18:43:22 UTC
README
This extension offers an easy method to setup various webfont frameworks to work with Yii Framework 2.0.
Installation
The preferred way to install this extension is through composer.
Note: Check the composer.json for this extension's requirements and dependencies.
Either run
$ php composer.phar require dalencar/yii2-webfontkit "dev-master"
or add
"dalencar/yii2-webfontkit": "dev-master"
to the require
section of your composer.json
file.
Usage
Global Setup
In case you wish to setup one or more Webfont framework globally, set the parameter webfontkit-framework
in the params
array of your Yii Configuration File.
'params' => [ 'webfontkit-framework' => [ 'os', // Open Sans Webfont framework ], ]
To initialize the globally setup framework, you can proceed in one of two ways:
- In your view, call this code in your view or view layout file:
use dalencar\webfontkit\WebFontKit; WebFontKit::register($this);
- Or in your asset bundle, adding the dalencar\webfontkit\WebFontKit class as depends
public $depends [ 'dalencar\webfontkit\WebFontKit', ],
Per View Setup
You can also call each icon-framework individually in your view or view layout like below. Map any icon framework within each view as in the example below.
use dalencar\webfontkit\WebFontKit; WebFontKit::register($this, WebFontKit::OS); // Register the Open Sans webfont framework
License
yii2-webfontkit is released under the BSD 3-Clause License. See the bundled LICENSE.md
for details.