/** @test */ public function it_load_custom_field_types_from_config() { $config = $this->config; $config['custom_fields']['datetime'] = 'App\\Forms\\DatetimeType'; $formHelper = new FormHelper($this->view, $this->request, $config); $this->assertEquals('App\\Forms\\DatetimeType', $formHelper->getFieldType('datetime')); }
/** * Set type of the field * * @param mixed $type * @return $this */ public function setType($type) { if ($this->formHelper->getFieldType($type)) { $this->type = $type; } return $this; }
/** * @param string $type * @return string */ protected function getFieldType($type) { $fieldType = $this->formHelper->getFieldType($type); if ($type == 'file') { $this->formOptions['files'] = true; } return $fieldType; }
/** * @param string $type * @return string */ protected function getFieldType($type) { $fieldType = $this->formHelper->getFieldType($type); return $fieldType; }