Download the PHP package xicrow/php-icons without Composer
On this page you can find all versions of the php package xicrow/php-icons. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-icons
PHP Icons
Installation
The recommended way to install is through Composer.
Usage
Depending on what icons you are using (or want to use), implement the icon class of your choice:
For now, we'll just use the BaseIcon
class, to show usages.
Basic usage, show an icon:
Apply one or more modifiers (not all icon packs support modifiers):
Modifiers can also be chained from the icon:
Attributes for the icon can also be set by chaining:
Untill the icon is rendered (either through the BaseIcon::render()
method or other to-string triggers like echo
), it is possible to add modifiers and attributes to the
icon.
Extending
Instead of using the classes in this repository directly, you are encouraged to implement your own extension like so:
This will ease your own implementation, since you determine what the class will be called and also makes it easier for you to change provider in the future.
It also makes it easy to implement shortcuts for commonly used icons:
Supported icon packs
Currently, there are generators and classes for the following icon packs:
- Bootstrap 3 Glyphicons
- Devicons
- FontAwesome 4
- FontAwesome 5 (free)
Generators are used to create the constants for icons (and modifiers) for each icon pack, these generators will mostly be able to generate constants for every specific version of the icon pack, thereby supporting exactly the version you are using.
Classes are simply the implementation of the specific icon pack, that is using the generated icon (and modifier) constants, and implementing a render method specific for that icon pack.
TODO
- Maby generate Interfaces for all versions of icon packs ?
- Will this clutter too much ?..
- If done, they should be within their own separate namespace
src/FontAwesome4/FontAwesome4_0_0Icons
(or something like that)
- Figure out if it's possible to get a list of FontAwesome 5 PRO icons
- Their public accessible list of icons is, of course, only the free icons
- Ideas for new icon generators/classes:
- Glyphicons
- IcoMoon
- Ionicons
- Material
- Icofont
- Icons8
- Typicons
- Microns
License
Copyright © 2022 Jan Ebsen Licensed under the MIT license.
All versions of php-icons with dependencies
ext-json Version *