Overview

Namespaces

  • Khill
    • Fontawesome
      • Exceptions
  • PHP

Classes

  • FontAwesome
  • FontAwesomeFacade
  • FontAwesomeList
  • FontAwesomeServiceProvider
  • FontAwesomeStack
  • Overview
  • Namespace
  • Class
  • Tree

Class FontAwesome

Namespace: Khill\Fontawesome
Located at FontAwesome.php
Methods summary
public static string
# css( )

HTML link to the FontAwesome CSS file through the bootstrapcdn

HTML link to the FontAwesome CSS file through the bootstrapcdn

Returns

string
HTML link element

See

http://www.bootstrapcdn.com/
public Khill\Fontawesome\FontAwesome
# __construct( string $icon = '' )

Assigns the name to the icon

Assigns the name to the icon

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object
public string
# __toString( )

Outputs the FontAwesome object as an HTML string

Outputs the FontAwesome object as an HTML string

Returns

string
HTML string of icon or stack
public
# store( string $label )

Stores icon to be rendered later

Stores icon to be rendered later

Parameters

$label
string
$label Label of icon to save in collection

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $label is not a string
Khill\Fontawesome\Exceptions\CollectionIconException
If store() method called without defining an icon
public string
# collection( string $label )

Retrieve icon from collection

Retrieve icon from collection

Parameters

$label
string
$label Icon label used in store method

Returns

string
HTML icon string

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $label is not a string
Khill\Fontawesome\Exceptions\CollectionIconException
If icon $label is not set
public Khill\Fontawesome\FontAwesome
# icon( string $icon )

Sets which icon to use

Sets which icon to use

Parameters

$icon
string
$icon Icon label, ommiting fa- prefix

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# addClass( string $class )

Adds extra classes to icon or stack

Adds extra classes to icon or stack

Parameters

$class
string
$class CSS class

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $class is not a string
public Khill\Fontawesome\FontAwesome
# fixedWidth( string $icon = '' )

Sets the icon or stack to be a fixed width

Sets the icon or stack to be a fixed width

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# lg( string $icon = '' )

Sets the icon or stack to be larger

Sets the icon or stack to be larger

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# x2( string $icon = '' )

Sets the icon or stack to be 2 times larger

Sets the icon or stack to be 2 times larger

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# x3( string $icon = '' )

Sets the icon or stack to be 3 times larger

Sets the icon or stack to be 3 times larger

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# x4( string $icon = '' )

Sets the icon or stack to be 4 times larger

Sets the icon or stack to be 4 times larger

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# x5( string $icon = '' )

Sets the icon or stack to be 5 times larger

Sets the icon or stack to be 5 times larger

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# inverse( string $icon = '' )

Sets the icon or stack to be inverted in color

Sets the icon or stack to be inverted in color

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# rotate90( string $icon = '' )

Sets the icon or stack to be rotated 90 degrees

Sets the icon or stack to be rotated 90 degrees

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# rotate180( string $icon = '' )

Sets the icon or stack to be rotated 180 degrees

Sets the icon or stack to be rotated 180 degrees

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# rotate270( string $icon = '' )

Sets the icon or stack to be rotated 270 degrees

Sets the icon or stack to be rotated 270 degrees

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# flipHorizontal( string $icon = '' )

Sets the icon or stack to be flipped horizontally

Sets the icon or stack to be flipped horizontally

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# flipVertical( string $icon = '' )

Sets the icon or stack to be flipped vertically

Sets the icon or stack to be flipped vertically

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# spin( string $icon = '' )

Sets the icon to spin

Sets the icon to spin

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# border( string $icon = '' )

Sets a border around the icon

Sets a border around the icon

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# left( string $icon = '' )

Pulls the icon to the left

Pulls the icon to the left

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# right( string $icon = '' )

Pulls the icon to the left

Pulls the icon to the left

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a string
public Khill\Fontawesome\FontAwesome
# ul( string $iconLabel = '' )

Builds unordered list with icons

Builds unordered list with icons

Parameters

$iconLabel
string
$iconLabel Default icon used in list (optional)

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object
public Khill\Fontawesome\FontAwesome
# li( string|array $iconLine = '' )

Adds items to unordered list with icons

Adds items to unordered list with icons

Parameters

$iconLine
string|array
$iconLine Adds a line or lines to the unordered list

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object
public Khill\Fontawesome\FontAwesome
# stack( string $icon )

Sets the top icon to be used in a stack

Sets the top icon to be used in a stack

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a non empty string
public Khill\Fontawesome\FontAwesome
# on( string $icon )

Sets the bottom icon to be used in a stack

Sets the bottom icon to be used in a stack

Parameters

$icon
string
$icon Icon label

Returns

Khill\Fontawesome\FontAwesome
FontAwesome object

Throws

Khill\Fontawesome\Exceptions\BadLabelException
If $icon is not a non empty string
Khill\Fontawesome\Exceptions\IncompleteStackException
If The on() method was called without the stack() method
Constants summary
string CDN_LINK '<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.1/css/font-awesome.min.css" rel="stylesheet">'
#

HTML Link tag to the FontAwesome CDN

HTML Link tag to the FontAwesome CDN

string ICON_HTML '<i class="fa %s"></i>'
#

Html string template to build the icon

Html string template to build the icon

string STACK_HTML '<span class="%s">%s%s</span>'
#

Html string template to build the icon stack

Html string template to build the icon stack

Properties summary
public array $collection array()
#

Store a collection of icons

Store a collection of icons

public string $stack
#

Stores icon stack

Stores icon stack

public string $list
#

Stores unordered list

Stores unordered list

API documentation generated by ApiGen 2.8.0