Example #1
0
 /**
  * Get the field id
  *
  * @param  InputInterface $field
  * @param  array          $attributes
  *
  * @return string
  */
 public function getFieldId(InputInterface $field, array $attributes = array())
 {
     $name = $field->getName();
     $field_attributes = $field->getAttributes();
     $id = trim(preg_replace('/[^a-z-]/', '-', "{$this->namespace}-{$name}"), '-');
     return array_get($attributes, 'id', array_get($field_attributes, 'id', $id));
 }