Exemplo n.º 1
0
 /**
  * Return a repeater field configuration array
  * @return array
  */
 public function build()
 {
     $config = parent::build();
     $fields = $this->fieldsBuilder->build();
     $config['sub_fields'] = $fields['fields'];
     if (array_key_exists('collapsed', $config)) {
         $fieldKey = $this->fieldsBuilder->getField($config['collapsed'])->getKey();
         $fieldKey = preg_replace('/^field_/', '', $fieldKey);
         $config['collapsed'] = $this->getName() . '_' . $fieldKey;
     }
     return $config;
 }
 /**
  * Return a configuration array
  * @return array
  */
 public function build()
 {
     return array_merge(parent::build(), ['layouts' => $this->buildLayouts()]);
 }
Exemplo n.º 3
0
 public function testBuild()
 {
     $subject = new FieldBuilder('my_field', 'text', ['prepend' => '$']);
     $this->assertArraySubset(['key' => 'field_my_field', 'name' => 'my_field', 'label' => 'My Field', 'type' => 'text', 'prepend' => '$'], $subject->build());
 }