Exemple #1
0
 public static function generator($name, $data, $selected_value)
 {
     foreach ($data as $value => $text) {
         $radio = new radio();
         $radio->name = $name;
         $radio->value = $value;
         if ((string) $radio->value === (string) $selected_value) {
             $radio->checked = "checked";
         }
         $label = new label();
         $label->class = "radio-inline";
         //Fit Bootstrap Style
         $label->appendContent($radio);
         $label->appendContent($text);
         (yield $label);
     }
 }