示例#1
0
 function input($tag, $content, $data, $attributes)
 {
     $name = $attributes["name"];
     $valueKey = $attributes["value"];
     //(array_key_exists("value",$attributes)) ? $data->get($attributes["value"]) : "";
     $value = TemplateLogic::content($valueKey, $data);
     $options = Options::parse($attributes["options"]);
     $validate = array_key_exists("validate", $attributes) ? $attributes["validate"] : false;
     if ($validate) {
         if (array_key_exists("class", $options)) {
             $options["class"] = "validate(" . $validate . ") " . $options["class"];
         } else {
             $options["class"] = "validate(" . $validate . ")";
         }
     }
     //$attributes["validate"];
     //var_dump($validate);
     switch ($tag) {
         case "check":
             $checked = array_key_exists("checked", $attributes) && $value == TemplateLogic::content($attributes["checked"], $data);
             $result = check_tag($name, $value, $checked, $options);
             break;
         case "text":
             $result = textarea_tag($name, $value, $options);
             break;
         case "file":
             $result = filefield_tag($name, $options);
             break;
         case "field":
             $result = textfield_tag($name, $value, $options);
             break;
         case "radio":
             $checked = array_key_exists("checked", $attributes) && $value == TemplateLogic::content($attributes["checked"], $data);
             $result = radio_tag($name, $value, $checked, $options);
             break;
         case "pass":
             $result = password_tag($name, $value, $options);
             break;
         case "option":
             $selected = $data->get("selected") == $value;
             $result = option_tag($name, $value, $selected);
             break;
         case "hidden":
             $result = hidden_tag($name, $value, $options);
             break;
     }
     return $result;
 }
示例#2
0
?>
">
    <label>Ages Allowed</label>
    <div>
      <div class="radio-inline">
        <label>
          <?php 
echo radio_tag($form, "minor", 0);
?>
          Adults Only
        </label>
      </div>
      <div class="radio-inline">
        <label>
          <?php 
echo radio_tag($form, "minor", 1);
?>
          Minors Only
        </label>
      </div>
    </div>
    <?php 
echo error_display($form, "minor");
?>
  </div>

  <div class="form-group <?php 
echo $form->error_on("vendor") ? "has-error" : "";
?>
">
    <label>Vendor Badge</label>
示例#3
0
            <div class="col-sm-12">
              <div class="radio">
                <label>
                  <?php 
echo radio_tag($form, "blacklist_type", "");
?>
                  <span class="label label-default">None</span>
                </label>
              </div>
              <?php 
foreach (BlacklistType::all() as $type) {
    ?>
                <div class="radio">
                  <label>
                    <?php 
    echo radio_tag($form, "blacklist_type", $type->db_name);
    ?>
                    <span class="label label-<?php 
    echo $type->alert_color;
    ?>
"><?php 
    echo $type->alert_title;
    ?>
</span>
                  </label>
                </div>
              <?php 
}
?>
            </div>
          </div>
示例#4
0
<div class="row">
  <div class="form-group col-sm-4 <?php 
echo $form->error_on("type") ? "has-error" : "";
?>
">

    <label>Blacklist Type</label>
    <div class="col-sm-12">
      <?php 
foreach ($types as $type) {
    ?>
        <div class="radio">
          <label>
            <?php 
    echo radio_tag($form, "type", $type->db_name);
    ?>
            <?php 
    if (true) {
        ?>
              <span class="label label-<?php 
        echo $type->alert_color;
        ?>
"><?php 
        echo $type->alert_title;
        ?>
</span>
            <?php 
    } else {
        ?>
              <?php 
示例#5
0
文件: form.php 项目: epochwolf/kairos
      <p>If you need a vendor badge, please inform the person checking you in.</p>

      <h3>Payment Method</h3>
      <div class="row">
        <div class="form-group col-sm-12 <?php 
echo $form->error_on("payment_method") ? "has-error" : "";
?>
">
          <div>
            <?php 
foreach ($payment_types as $type) {
    ?>
              <div class="radio-inline">
                <label>
                  <?php 
    echo radio_tag($form, "payment_method", $type->db_name);
    ?>
                  <?php 
    echo $type->name;
    ?>
                </label>
              </div>
            <?php 
}
?>
            <?php 
echo error_display($form, "payment_method");
?>
          </div>
        </div>