示例#1
0
 protected function getTemplateContent($input)
 {
     if (!empty($input['label'])) {
         $content = '<div class="gcore-input gcore-display-table" id="custom_' . $input['id'] . '">';
     }
     if (!empty($input['pre_content'])) {
         $content .= $input['pre_content'];
     }
     $content .= parent::openInputTag($input);
     // Abre
     $content .= ' class="form-control A ' . $input['class'] . '"';
     if (!empty($input['id'])) {
         $content .= ' id="' . $input['id'] . '"';
     }
     if (!empty($input['name'])) {
         $content .= ' name="' . $input['name'] . '"';
     }
     if (!empty($input['value'])) {
         $content .= ' value="' . $input['value'] . '"';
     }
     if (!empty($input['data']) && !empty($input['data_name'])) {
         $content .= ' data-' . $input['data_name'] . '="' . $input['data'] . '"';
     }
     $content .= ' ' . $input['extra_param'];
     $content .= ' >';
     if ($input['type'] == "select" || $input['type'] == "datalist" || $input['type'] == "radiogroup") {
         if ($input['type'] == "datalist") {
             $content .= '<datalist id="' . $input['datalist_id'] . '">';
         }
         if (!empty($input['placeholder'])) {
             $default_option = array("", $input['placeholder']);
         }
         $content .= parent::buildSelect($input, $default_option);
     }
     /*
             if (!empty($input['label'])) {
                 $content .= "</div>";
             }
     */
     if (!empty($input['inside_post_content'])) {
         $content .= $input['inside_post_content'];
     }
     $content .= parent::closeInputTag($input);
     if (!empty($input['outside_post_content'])) {
         $content .= $input['outside_post_content'];
     }
     return $content;
 }