/** * 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>'); }
/** * 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>'); }
/** * Convert an HTML string to entities. * * @param string $value * @return string * @static */ public static function entities($value) { return \Collective\Html\HtmlBuilder::entities($value); }