|
@@ -950,12 +950,17 @@ class Field implements Renderable
|
|
|
* Set element class.
|
|
|
*
|
|
|
* @param string|array $class
|
|
|
+ * @param bool $normalize
|
|
|
*
|
|
|
* @return $this
|
|
|
*/
|
|
|
- public function setElementClass($class)
|
|
|
+ public function setElementClass($class, bool $normalize = true)
|
|
|
{
|
|
|
- $this->elementClass = array_merge($this->elementClass, (array) $this->normalizeElementClass($class));
|
|
|
+ if ($normalize) {
|
|
|
+ $class = $this->normalizeElementClass($class);
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->elementClass = array_merge($this->elementClass, (array) $class);
|
|
|
|
|
|
return $this;
|
|
|
}
|
|
@@ -964,12 +969,13 @@ class Field implements Renderable
|
|
|
* Add element class.
|
|
|
*
|
|
|
* @param string|array $class
|
|
|
+ * @param bool $normalize
|
|
|
*
|
|
|
* @return $this
|
|
|
*/
|
|
|
- public function addElementClass($class)
|
|
|
+ public function addElementClass($class, bool $normalize = false)
|
|
|
{
|
|
|
- $this->setElementClass($class);
|
|
|
+ $this->setElementClass($class, $normalize);
|
|
|
|
|
|
$this->elementClass = array_values(array_unique(array_merge($this->elementClass, $this->getDefaultElementClass())));
|
|
|
|
|
@@ -1082,22 +1088,6 @@ class Field implements Renderable
|
|
|
return $this->form ? $this->form->getElementId() : null;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Add the element class.
|
|
|
- *
|
|
|
- * @param $class
|
|
|
- *
|
|
|
- * @return $this
|
|
|
- */
|
|
|
- public function addElementClass($class)
|
|
|
- {
|
|
|
- $this->elementClass = array_unique(
|
|
|
- array_merge($this->elementClass, (array) $class)
|
|
|
- );
|
|
|
-
|
|
|
- return $this;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Remove element class.
|
|
|
*
|