Basic functionality

This commit is contained in:
2022-03-12 16:25:30 +01:00
parent f3beaa64cf
commit acc21b7b24
137 changed files with 12647 additions and 5089 deletions

31
app/ui/Form/BaseForm.php Executable 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;
}
}