コード例 #1
0
ファイル: Control.php プロジェクト: stevebauman/html
 /**
  * Resolve method name and type.
  *
  * @param  string  $value
  * @param  \Illuminate\Support\Fluent  $data
  *
  * @return \Illuminate\Support\Fluent
  */
 protected function resolveFieldType($value, Fluent $data)
 {
     $filterable = array_keys($this->templates);
     if (preg_match('/^(input):([a-zA-Z]+)$/', $value, $matches)) {
         $value = $matches[2];
     } elseif (!in_array($value, $filterable)) {
         $value = 'text';
     }
     if (in_array($value, $filterable)) {
         $data->method($value);
     } else {
         $data->method('input')->type($value);
     }
     return $data;
 }