html() static public method

Converts a string to a html-safe string
static public html ( string $string, boolean $keep_html = true ) : string
$string string
$keep_html boolean True: lets stuff inside html tags untouched.
return string The html string
Beispiel #1
0
 /**
  * Echos the success/error feedback message directly as a HTML-safe string.
  */
 public function echoMessage()
 {
     echo str::html($this->message());
 }
Beispiel #2
0
 /**
  * Creates a link tag
  *
  * @param  string  $link The URL
  * @param  string  $text Specify a text for the link tag. If false the URL will be used
  * @return string  
  */
 static function link($link, $text = false)
 {
     $text = $text ? $text : $link;
     return '<a href="' . $link . '">' . str::html($text) . '</a>';
 }
Beispiel #3
0
 /**
  * Echos the success/error feedback message directly as a HTML-safe string.
  * Either from one specified action or from all actions.
  *
  * @param mixed $action (optional) the index of the action to get the
  * feedback message from
  */
 public function echoMessage($action = false)
 {
     echo str::html($this->message($action));
 }
Beispiel #4
0
function html($text)
{
    return str::html($text, false);
}
Beispiel #5
0
 public function testHtml()
 {
     $this->assertEquals('Super &Auml;wes&oslash;me String', str::html($this->sample));
 }
 function testHtml()
 {
     $this->assertEqual(str::html("some <em>über crazy</em> stuff"), 'some <em>&uuml;ber crazy</em> stuff');
     $this->assertEqual(str::html('some <em>über crazy</em> stuff', false), 'some &lt;em&gt;&uuml;ber crazy&lt;/em&gt; stuff');
 }