Esempio n. 1
0
 /**
 * 
 * $content .= f::inputSet(
    f::input(
      $form->createTypeSelect('\SerienLoader\Status',$episode->getStatus())
    )
 */
 public function createTypeSelect($typeClass, $selected, $label = NULL, $field = NULL)
 {
     $type = $typeClass::instance();
     $values = $type->getValues();
     $options = array_combine($values, array_map('ucfirst', $values));
     if (!isset($field)) {
         $field = lcfirst(Code::getClassName($typeClass));
         // sowas wie \tiptoi\SpeakerType => speakerType
     }
     if (!isset($label)) {
         $label = ucfirst($field);
     }
     return f::select($label, lcfirst($field), $options, $selected);
 }