entities() public method

Convert an HTML string to entities.
public entities ( string $value ) : string
$value string
return string
Example #1
0
 /**
  * Create a form label element.
  *
  * @param string $name
  * @param string $value
  * @param array  $options
  * @param bool   $escape_html
  *
  * @return \Illuminate\Support\HtmlString
  */
 public function label($name, $value = null, $options = [], $escape_html = true)
 {
     $this->labels[] = $name;
     $options = $this->html->attributes($options);
     $value = $this->formatLabel($name, $value);
     if ($escape_html) {
         $value = $this->html->entities($value);
     }
     return $this->toHtmlString('<label for="' . $name . '"' . $options . '>' . $value . '</label>');
 }
Example #2
0
 /**
  * Create a button element.
  *
  * @param  string  $value
  * @param  array   $options
  * @param  bool    $escape
  *
  * @return \Illuminate\Support\HtmlString
  */
 public function button($value = null, $options = [], $escape = true)
 {
     if (!array_key_exists('type', $options)) {
         $options['type'] = 'button';
     }
     if ($escape) {
         $value = $this->html->entities($value);
     }
     return $this->toHtmlString('<button' . $this->html->attributes($options) . '>' . $value . '</button>');
 }
Example #3
0
 /**
  * Convert an HTML string to entities.
  *
  * @param string $value
  * @return string 
  * @static 
  */
 public static function entities($value)
 {
     return \Collective\Html\HtmlBuilder::entities($value);
 }