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