Download the PHP package kartik-v/yii2-icons without Composer
On this page you can find all versions of the php package kartik-v/yii2-icons. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-icons
yii2-icons
This extension offers an easy method to setup various icon frameworks to work with Yii Framework 2.0. Most popular and free icon frameworks available are currently supported. This list may be extended in future based on demand and feedback.
- Bootstrap Glyphicons
- Font Awesome
- Unicode Icons: A collection of unicode symbols made available as CSS icons by Krajee
- Elusive Icons
- Typicons
- Web Hosting Hub Glyphs
- JQuery UI Icons
- Socicon Icons: Needs you to add attribution to the icon source.
- Octicons: The Github icons collection.
- Flag-Icons
- Open Iconic Icons
- IcoFont Icons
Demo
You can see a demonstration here and API Code Documentation on usage of this extension with documentation and examples.
Installation
The preferred way to install this extension is through composer.
Note: Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the
minimum-stability
settings for your application's composer.json.
Either run
or add
to the require
section of your composer.json
file.
Usage
Global Setup
In case you wish to setup one Icon framework globally, set the parameter icon-framework
in the params
array of your Yii Configuration File.
To initialize the globally setup framework in your view, call this code in your view or view layout file.
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.
Displaying Icons
After mapping your icon framework with one of the options above, you can display icons using Icon::show
method. Icons can be displayed using one of the options below:
NOTE: The
kartik\icons\Icon::show
method outputs a HTML formatted text. So in order to display icons in Yii-2 components like Navbar or Nav, you must setencodeLabels
to false.
Displaying Stacked Icons
You can also display stacked icons for frameworks like Font Awesome, where this is supported. For example:
Add Custom Icons
You can add custom icon sets to the list of available frameworks.
The above asset bundle uses files genereted by http://fontello.com/.
License
yii2-icons is released under the BSD-3-Clause License. See the bundled LICENSE.md
for details.
All versions of yii2-icons with dependencies
yiisoft/yii2-jui Version *
components/flag-icon-css Version *