added entities and decode method.
This commit is contained in:
1 parent
4254f09155
commit
9b8cb828a8
1 file changed
+22
@@ -2,6 +2,28 @@
|
||||
|
||||
class HtmlBuilder {
|
||||
|
||||
/**
|
||||
* Convert an HTML string to entities.
|
||||
*
|
||||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
public static function entities($value)
|
||||
{
|
||||
return htmlentities($value, ENT_QUOTES, 'UTF-8', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert entities to HTML characters.
|
||||
*
|
||||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
public static function decode($value)
|
||||
{
|
||||
return html_entity_decode($value, ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an ordered list of items.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user