added entities and decode method.

This commit is contained in:
Taylor Otwell committed 2013-02-28 14:29:16 -06:00
1 parent 4254f09155
commit 9b8cb828a8
1 file changed
+22
+22
View File
@@ -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.
*