org.zenmagick.mvc.utils\ZMHtmlUtils
mvc\utils\ZMHtmlUtils.php at line 30
Class ZMHtmlUtils
ZMHtmlUtils
public class ZMHtmlUtils
- Author:
- DerManoMann
| Method Summary |
| static string |
encode(string s) Encode a given string to valid HTML. |
| static string |
more(string s, int max, string more) Truncate text. |
| static string |
strip(string text, array tags) Strip HTML tags from the given text. |
| static string |
text2html(string s) Convert text based user input into HTML. |
Method Detail
mvc\utils\ZMHtmlUtils.php at line 38
encode
public static string encode(string s)
Encode a given string to valid HTML.
- Parameters:
- s - The string to encode.
- Returns:
- The encoded HTML.
mvc\utils\ZMHtmlUtils.php at line 65
more
public static string more(string s, int max, string more)
Truncate text.
- Parameters:
- s - The text.
- max - The number of allowed characters; default is 0 for all.
- more - Optional string that will be appended to indicate that the text was truncated; default is ....
- Returns:
- The (possibly) truncated text.
mvc\utils\ZMHtmlUtils.php at line 85
strip
public static string strip(string text, array tags)
Strip HTML tags from the given text.
- Parameters:
- text - The text to clean up.
- tags - Optional list of tags to deal with explicitely; default is
array('strong','b','u','i','em').
- Returns:
- The stripped text.
mvc\utils\ZMHtmlUtils.php at line 50
text2html
public static string text2html(string s)
Convert text based user input into HTML.
- Parameters:
- s - The input string.
- Returns:
- HTML formatted text.
HTML utilities.