github.com/keysonZZZ/kmg@v0.0.0-20151121023212-05317bfd7d39/kmgView/kmgBootstrap/tplButton.gotplhtml (about) 1 <? package kmgBootstrap 2 func tplButton (button Button) string { ?> 3 <<?= string(button.Type) ?> <? if button.FormId != "" { ?> form="<?= button.FormId ?>" <? } ?> 4 <? if button.Type == ButtonTypeA { ?> 5 <? if button.Url == "" { ?> 6 href="javascript:void(0);" 7 <? } else { ?> 8 href="<?= button.Url ?>" 9 <? } ?> 10 <? } ?> 11 <? if button.Name!="" { ?> 12 name="<?=button.Name?>" 13 <? } ?> 14 <? if button.Value!="" { ?> 15 value="<?=button.Value?>" 16 <? } ?> 17 <? if button.Type == ButtonTypeButton { ?> 18 type="submit" 19 <? } ?> 20 <? if button.AttributeNode != nil { ?> 21 <?= raw(button.AttributeNode.HtmlRender())?> 22 <? } ?> 23 class="btn <?= string(button.Color) ?> <?= string(button.Size) ?> <?= button.ClassName ?>" 24 id="<?= button.Id ?>" 25 > 26 <?= raw(button.Content.HtmlRender()) ?> 27 </<?= string(button.Type) ?>> 28 <? } ?>