Download the PHP package tobento/service-icon without Composer
On this page you can find all versions of the php package tobento/service-icon. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package service-icon
Icon Service
Managing icons for PHP applications.
Table of Contents
- Getting started
- Requirements
- Highlights
- Documentation
- Icon Interface
- Icon
- Icon Factory Interface
- Icon Factory
- Icon Factory Translator
- Icons Interface
- Svg File Icons
- Svg File Icons To Json File
- Svg File Icons To Json Files
- In Memory Html Icons
- Icons
- Stack Icons
- Example
- Font Awesome
- Icon Interface
- Credits
Getting started
Add the latest version of the icon service project running this command.
Requirements
- PHP 8.0 or greater
Highlights
- Framework-agnostic, will work with any project
- Decoupled design
- Customizable with factories to fit your needs
Documentation
Icon Interface
name
Returns the icon name.
render
Returns the icon.
Both icons from above will produce the following output:
size
Returns a new instance with the specified size.
attr
Returns a new instance with the specified attribute.
Adds a class to existing classes:
Overwrites existing classes:
label
Returns a new instance with the specified label and position.
labelSize
Returns a new instance with the specified label size.
labelAttr
Returns a new instance with the specified label size.
Adds a class to existing classes:
Overwrites existing classes:
tag
Returns a new instance of the icon tag.
Check out Tag Interface to learn more about the interface.
Icon
You may check out the Tag Service to learn more about it.
Icon Factory Interface
Easily create icons with the provided icon factory:
createIcon
createIconFromHtml
createIconFromFile
Icon Factory
The default icon factory will produce the following icon output:
output:
size class map
You might create your own factory to adjust css sizes for your needs:
Icon Factory Translator
Translates the svg tag. You might enhance it for your needs though.
You may check out the Translation Service to learn more about it.
Icons Interface
get
has
Svg File Icons
This class creates icons from svg files.
Svg File Icons To Json File
This class creates icons from svg files but caches all in one json file.
Svg File Icons To Json Files
This class creates icons from svg files but caches each in a json file.
In Memory Html Icons
Icons
This icons class might be used for custom factories.
Stack Icons
The StackIcons class allows combining any number of other icons. If the requested icon does not exist in the first icons collection, the next icons will try and so on.
Example
Font Awesome
This might be a possible way to create font awesome icons:
output:
Credits
- Tobias Strub
- All Contributors
All versions of service-icon with dependencies
tobento/service-tag Version ^1.0.5
tobento/service-dir Version ^1.0
tobento/service-filesystem Version ^1.0
tobento/service-file-creator Version ^1.0