Html escaping is now optional for labels

This commit is contained in:
Stefan Printezis committed 2016-03-23 13:13:50 +01:00
1 parent 02c75dff24
commit d65deb4e77
2 files changed
+9 -2

No files matched your search

Executable → Regular
+7 -2
View File
@@ -210,16 +210,21 @@ class FormBuilder
* @param string $name
* @param string $value
* @param array $options
* @param bool $escape_html
*
* @return \Illuminate\Support\HtmlString
*/
public function label($name, $value = null, $options = [])
public function label($name, $value = null, $options = [], $escape_html = true)
{
$this->labels[] = $name;
$options = $this->html->attributes($options);
$value = e($this->formatLabel($name, $value));
$value = $this->formatLabel($name, $value);
if ($escape_html) {
$value = $this->html->entities($value);
}
return $this->toHtmlString('<label for="' . $name . '"' . $options . '>' . $value . '</label>');
}