html() статический публичный Метод

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.
Результат string The html string
Пример #1
0
 /**
  * Echos the success/error feedback message directly as a HTML-safe string.
  */
 public function echoMessage()
 {
     echo str::html($this->message());
 }
Пример #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>';
 }
Пример #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));
 }
Пример #4
0
function html($text)
{
    return str::html($text, false);
}
Пример #5
0
 public function testHtml()
 {
     $this->assertEquals('Super &Auml;wes&oslash;me String', str::html($this->sample));
 }
Пример #6
0
 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');
 }