Created
February 26, 2015 13:01
-
-
Save martiman/f097027986c464e41824 to your computer and use it in GitHub Desktop.
Obecná latte šablona pro vykreslení formuláře pomocí BS3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form n:name=$form class="form"> | |
<div class="row"> | |
<div class="col-md-12"> | |
<ul class=error n:if="$form->ownErrors"> | |
<li n:foreach="$form->ownErrors as $error">{$error}</li> | |
</ul> | |
</div> | |
</div> | |
<div class="row"> | |
{foreach $form->controls as $input} | |
{* get_class($input) *} | |
<div n:if="$input instanceof Nette\Forms\Controls\Checkbox" class="form-group {$class} {$input->required ? required}"> | |
<label n:if="$input->caption" n:name="$input->name"> | |
<input type="checkbox" n:name="$input"> | |
{$input->caption} | |
</label> | |
<span class=error n:ifcontent>{$input->error}</span> | |
</div> | |
<div n:if="$input instanceof Nette\Forms\Controls\TextInput" class="form-group {$class} {$input->required ? required}"> | |
<label n:if="$input->label" n:name="$input" class="control-label">{$input->caption}</label> | |
<input n:if="$input instanceof Nette\Forms\Controls\TextInput" n:name="$input" class="form-control"> | |
<span class=error n:ifcontent>{$input->error}</span> | |
</div> | |
{/foreach} | |
</div> | |
<div class="row"> | |
{foreach $form->controls as $input} | |
<div n:if="$input instanceof Nette\Forms\Controls\SubmitButton" class="col-md-3"> | |
<input n:name="$input" class="btn btn-success"> | |
</div> | |
{/foreach} | |
</div> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment