Skip to content
Snippets Groups Projects

Issue #3311480: Remove the need of preprocess hooks: add_class & set_attributes

Open Issue #3311480: Remove the need of preprocess hooks: add_class & set_attributes
1 unresolved thread
Open Pierre Dureau requested to merge issue/ui_patterns-3311480:pierre_proposal into 8.x-1.x
1 unresolved thread
2 files
+ 128
0
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -21,6 +21,8 @@ class PatternDefinitionField implements \ArrayAccess {
'label' => NULL,
'description' => NULL,
'type' => NULL,
'add_class' => NULL,
'set_attribute' => NULL,
'preview' => NULL,
'escape' => TRUE,
'additional' => [],
@@ -186,4 +188,24 @@ class PatternDefinitionField implements \ArrayAccess {
return $this;
}
/**
* Get classes to add to field value.
*
* @return array
* Classes list.
*/
public function getClassesToAdd() {
return $this->definition['add_class'];
}
/**
* Get attributes to set to field value.
*
* @return array
* Attributes dict.
*/
public function getAttributesToSet() {
return $this->definition['set_attribute'];
}
}
Loading