Skip to content

Commit

Permalink
addFloat support
Browse files Browse the repository at this point in the history
  • Loading branch information
dakorpar committed Jan 18, 2024
1 parent 7282105 commit 2f7eccf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Traits/BootstrapContainerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,20 @@ public function addInteger(string $name, $label = null): NetteTextInput
->addRule(Form::INTEGER);
}

/**
* @param string|Html|null $label
* @return TextInput
*/
public function addFloat(string $name, $label = null): NetteTextInput
{

return $this->addText($name, $label)
->setNullable(BootstrapForm::$allwaysUseNullable)
->setHtmlType('number')
->setHtmlAttribute('step', 'any')
->addRule(Form::Float);
}

/**
* @param string|Html|null $label
* @param string[]|null $items
Expand Down

0 comments on commit 2f7eccf

Please sign in to comment.