dev-master
9999999-devYii2 Web Font Loader Wrapper
BSD-3-Clause
The Requires
extension yii2 google font web font loader
1.0.0
1.0.0.0Yii2 Web Font Loader Wrapper
BSD-3-Clause
The Requires
extension yii2 google font web font loader
Yii2 Web Font Loader Wrapper
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist "mzdani/yii2-webfont-loader" "dev-master"
or add, (*4)
"mzdani/yii2-webfont-loader": "dev-master"
to the require section of your composer.json
file., (*5)
Below is some example how to use the wrapper., (*6)
#!php false, 'event' => false, 'timeout' => 2000, 'context' => "frames['my-child']", 'text' => 'abcdefghijklmnopqrstuvwxyz!', 'callback' => [ 'loading' => 'function(){}', 'active' => 'function(){}', 'inactive' => 'function(){}', 'fontloading' => 'function(familyName, fvd) {}', 'fontactive' => 'function(familyName, fvd) {console.log(\'font name\'+familyName);}', 'fontinactive' => 'function(familyName, fvd) {}', ], 'CssFontName' => 'Roboto Condensed', 'type' => 'google', 'families' => ['Roboto+Condensed:400,700,300:latin'], ]); WebFontLoader::widget([ 'CssFontName' => 'Roboto Condensed', 'type' => 'typekit', 'families' => 'xxxx', ]); WebFontLoader::widget([ 'CssFontName' => 'Roboto Condensed', 'type' => 'fontdeck', 'families' => 'xxxx', ]); WebFontLoader::widget([ 'CssFontName' => 'Roboto Condensed', 'type' => 'monotype', 'families' => [ 'id' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'ver' => 12345 ], ]); ?>
You must use CssFontName
because the script automatically create <style>
to call the font. I use it so I can dynamically change font without editing css file., (*7)
Yii2 Web Font Loader Wrapper
BSD-3-Clause
extension yii2 google font web font loader
Yii2 Web Font Loader Wrapper
BSD-3-Clause
extension yii2 google font web font loader