Maslosoft Framework Logo Maslosoft Framework Documentation
Flexible Application Foundation


HTML Decorator

Decorator is specifically suited to output icons and wrap text with appropriate styling for predefined scenarios.

Available methods:

Decorator::alert()

Display informative alert box of text with optional color styled depending on $type of one of MessageType constants:

Will display successfully styled:

Decorator::alert('My message', MessageType::Success);

All possible constants:

  • MessageType::Standard
  • MessageType::Success
  • MessageType::Notice
  • MessageType::Warning
  • MessageType::Error

Decorator::badge()

Badge with large svg image. NOTE: Badge is hidden on small devices

Decorator::copyright()

Display copyright years automatically adjusting to current year:

Decorator::copyright(2001);

Will return 2001 - 2016

Decorator::fa()

Create fontawesome icon using i tag. To create icon only required param is icon name (without fa- prefix):

echo Decorator::fa('calendar');

Additionally options can be specified according to fontawesome extra classes. These can be string or array:

Twice larger:

echo Decorator::fa('calendar', '2x');

Fixed width and twice larger:

echo Decorator::fa('calendar', ['2x', 'fw']);

There are other options available:

  • lg - 33% larger
  • 2...5x - Twice up to five times larger icons
  • li - To put as a list bullet - need also fa-ul on parent ul tag
  • border - Put border around icon
  • pull-right, pull-left - respectively float icon to right or left
  • spin, pulse - to add rotating animations
  • rotate-90, rotate-180, rotate-270 - to rotate icon
  • flip-horizontal, flip-vertical - to mirror icon across vertical or horizontal axis

Any other CSS class can be added as option too, for example:

echo Decorator::fa('calendar', ['2x', 'fw', 'text-success]);

Decorator::icon()

Display bitmap icon

Decorator::init()

Decorator::kbd()

Wrap key parameter with kbd tag, mostly to show keyboard shortcuts.

Decorator::madeBy()

Display made by Maslosoft link

Decorator::textBackendTitle()

Display title suitable for backend of application

Decorator::textInfo()

Display informative block of text with optional color and icon styled depending on $type of one of MessageType constants:

Will display successfully styled (possibly green, it depends on styles) text with thumbs-up icon:

Decorator::textInfo('My message', MessageType::Success);

All possible constants:

  • MessageType::Standard
  • MessageType::Success
  • MessageType::Notice
  • MessageType::Warning
  • MessageType::Error

Decorator::textMuted()

Display text styled to be barely noticed, possibly for some really not important or mostly obvious tips.