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.
|
* Parse xxxxx.glyph file to bootstrap glyph format.
|
||||||
* @param string $text
|
* @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', 'spin=1');
|
||||||
* @example $tp->toGlyph('fa-spinner', array('spin'=>1));
|
* @example $tp->toGlyph('fa-spinner', array('spin'=>1));
|
||||||
* @example $tp->toGlyph('fa-shield', array('rotate'=>90, 'size'=>'2x'));
|
* @example $tp->toGlyph('fa-shield', array('rotate'=>90, 'size'=>'2x'));
|
||||||
*/
|
*/
|
||||||
public function toGlyph($text, $space=" ")
|
public function toGlyph($text, $options=" ")
|
||||||
{
|
{
|
||||||
|
|
||||||
if(empty($text))
|
if(empty($text))
|
||||||
@@ -3662,15 +3666,15 @@ class e_parser
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_array($space))
|
if(is_array($options))
|
||||||
{
|
{
|
||||||
$parm = $space;
|
$parm = $options;
|
||||||
$space = varset($parm['space'],'');
|
$options = varset($parm['space'],'');
|
||||||
}
|
}
|
||||||
elseif(strpos($space,'='))
|
elseif(strpos($options,'='))
|
||||||
{
|
{
|
||||||
parse_str($space,$parm);
|
parse_str($options,$parm);
|
||||||
$space = varset($parm['space'],'');
|
$options = varset($parm['space'],'');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3744,7 +3748,7 @@ class e_parser
|
|||||||
$class = (!empty($parm['class'])) ? $parm['class']." " : '';
|
$class = (!empty($parm['class'])) ? $parm['class']." " : '';
|
||||||
|
|
||||||
$text = "<".$tag." {$idAtt}class='".$class.$prefix.$id.$size.$spin.$rotate.$fixedW."' {$style}></".$tag.">" ;
|
$text = "<".$tag." {$idAtt}class='".$class.$prefix.$id.$size.$spin.$rotate.$fixedW."' {$style}></".$tag.">" ;
|
||||||
$text .= ($space !== false) ? $space : "";
|
$text .= ($options !== false) ? $options : "";
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user