mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
Improved docs on toGlyph() method.
This commit is contained in:
@@ -3649,12 +3649,16 @@ class e_parser
|
||||
/**
|
||||
* Parse xxxxx.glyph file to bootstrap glyph format.
|
||||
* @param string $text
|
||||
* @param array of $parms
|
||||
* @param array|string $options
|
||||
* @param bool $options['size'] 2x, 3x, 4x, or 5x
|
||||
* @param bool $options['fw'] Fixed-Width
|
||||
* @param bool $options['spin'] Spin
|
||||
* @param int $options['rotate'] Rotate in Degrees.
|
||||
* @example $tp->toGlyph('fa-spinner', 'spin=1');
|
||||
* @example $tp->toGlyph('fa-spinner', array('spin'=>1));
|
||||
* @example $tp->toGlyph('fa-shield', array('rotate'=>90, 'size'=>'2x'));
|
||||
*/
|
||||
public function toGlyph($text, $space=" ")
|
||||
public function toGlyph($text, $options=" ")
|
||||
{
|
||||
|
||||
if(empty($text))
|
||||
@@ -3662,15 +3666,15 @@ class e_parser
|
||||
return false;
|
||||
}
|
||||
|
||||
if(is_array($space))
|
||||
if(is_array($options))
|
||||
{
|
||||
$parm = $space;
|
||||
$space = varset($parm['space'],'');
|
||||
$parm = $options;
|
||||
$options = varset($parm['space'],'');
|
||||
}
|
||||
elseif(strpos($space,'='))
|
||||
elseif(strpos($options,'='))
|
||||
{
|
||||
parse_str($space,$parm);
|
||||
$space = varset($parm['space'],'');
|
||||
parse_str($options,$parm);
|
||||
$options = varset($parm['space'],'');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3744,7 +3748,7 @@ class e_parser
|
||||
$class = (!empty($parm['class'])) ? $parm['class']." " : '';
|
||||
|
||||
$text = "<".$tag." {$idAtt}class='".$class.$prefix.$id.$size.$spin.$rotate.$fixedW."' {$style}></".$tag.">" ;
|
||||
$text .= ($space !== false) ? $space : "";
|
||||
$text .= ($options !== false) ? $options : "";
|
||||
|
||||
return $text;
|
||||
|
||||
|
Reference in New Issue
Block a user