/** @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'));
 }
示例#2
0
 /**
  * Set type of the field
  *
  * @param mixed $type
  * @return $this
  */
 public function setType($type)
 {
     if ($this->formHelper->getFieldType($type)) {
         $this->type = $type;
     }
     return $this;
 }
示例#3
0
 /**
  * @param string $type
  * @return string
  */
 protected function getFieldType($type)
 {
     $fieldType = $this->formHelper->getFieldType($type);
     if ($type == 'file') {
         $this->formOptions['files'] = true;
     }
     return $fieldType;
 }
示例#4
0
 /**
  * @param string $type
  * @return string
  */
 protected function getFieldType($type)
 {
     $fieldType = $this->formHelper->getFieldType($type);
     return $fieldType;
 }