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% larger2
...5x
- Twice up to five times larger iconsli
- To put as a list bullet - need alsofa-ul
on parentul
tagborder
- Put border around iconpull-right
,pull-left
- respectively float icon to right or leftspin
,pulse
- to add rotating animationsrotate-90
,rotate-180
,rotate-270
- to rotate iconflip-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.