Can set class attribute in array. (#521)

In case of you want to add class by condition.

```
Form::text('name', null, ['class' => [
    'form-control-,
    $error ? 'is-invalid' : '',
]]);
```
This commit is contained in:
ThunderbirdsX3 authored and Tom Shafer committed 2018-05-30 09:09:07 -07:00
1 parent 6d1ccebb53
commit fda9d3dad8
3 files changed
+30

No files matched your search

+4
View File
@@ -455,6 +455,10 @@ class HtmlBuilder
return $value ? $key : '';
}
if (is_array($value) && $key === 'class') {
return 'class="' . implode(' ', $value) . '"';
}
if (! is_null($value)) {
return $key . '="' . e($value, false) . '"';
}