This commit is contained in:
2022-01-13 18:41:03 +01:00
commit 0fb9f639da
159 changed files with 13183 additions and 0 deletions

31
app/ui/Form/BaseForm.php Normal file
View File

@@ -0,0 +1,31 @@
<?php declare(strict_types = 1);
namespace App\UI\Form;
use Nette\Application\UI\Form;
use Nette\Forms\Controls\TextInput;
class BaseForm extends Form
{
public function addFloat(string $name, ?string $label = null): TextInput
{
$input = self::addText($name, $label);
$input->addCondition(self::FILLED)
->addRule(self::MAX_LENGTH, null, 255)
->addRule(self::FLOAT);
return $input;
}
public function addNumeric(string $name, ?string $label = null): TextInput
{
$input = self::addText($name, $label);
$input->addCondition(self::FILLED)
->addRule(self::MAX_LENGTH, null, 255)
->addRule(self::NUMERIC);
return $input;
}
}