Skip to content

Commit bff4f72

Browse files
Update Button.php
add addClass method
1 parent 3367262 commit bff4f72

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Html/Button.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,23 @@ public function className($value)
113113
return $this;
114114
}
115115

116+
/**
117+
* Append a class name to column.
118+
*
119+
* @param string $class
120+
* @return $this
121+
*/
122+
public function addClass($class)
123+
{
124+
if (! isset($this->attributes['className'])) {
125+
$this->attributes['className'] = $class;
126+
} else {
127+
$this->attributes['className'] .= " $class";
128+
}
129+
130+
return $this;
131+
}
132+
116133
/**
117134
* Set text option value.
118135
*

0 commit comments

Comments
 (0)