Merge pull request #174 from StefanPrintezis/form_label_html

Html escaping is now optional for labels
This commit is contained in:
Matt Lantz authored and GitHub committed 2016-06-10 11:26:30 -04:00
commit f6d9a66624
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>');
}