1
|
<?php
|
2
|
|
3
|
namespace App\Components;
|
4
|
|
5
|
use App\Enum\ELogicalConditions;
|
6
|
use Nette\Application\UI\Control;
|
7
|
use Nette\Forms\Form;
|
8
|
|
9
|
class TransliterationSearchForm extends Control
|
10
|
{
|
11
|
public function render()
|
12
|
{
|
13
|
$this->template->setFile(__DIR__ . '/TransliterationSearchForm.latte');
|
14
|
$this->template->render();
|
15
|
}
|
16
|
|
17
|
public function createComponentForm()
|
18
|
{
|
19
|
$form = new Form();
|
20
|
$form->addText('word1', 'Word 1');
|
21
|
$form->addText('word2', 'Word 2');
|
22
|
$form->addSelect('word2_condition', '', ELogicalConditions::$selectValues);
|
23
|
$form->addText('word3', 'Word 3');
|
24
|
$form->addSelect('word3_condition', '', ELogicalConditions::$selectValues);
|
25
|
|
26
|
$form->addSubmit('submit', 'Search');
|
27
|
|
28
|
$form->onSuccess[] = [$this, 'formSubmit'];
|
29
|
|
30
|
return $form;
|
31
|
}
|
32
|
|
33
|
public function formSubmit()
|
34
|
{
|
35
|
|
36
|
}
|
37
|
}
|
38
|
|
39
|
interface ITransliterationSearchFormFactory{
|
40
|
/**
|
41
|
* @return TransliterationSearchForm
|
42
|
*/
|
43
|
public function create();
|
44
|
}
|