View difference between Paste ID: JseZQ23X and Cx16zKFc
SHOW: | | - or go back to the newest paste.
1
class CreateOrEditUserFormFactory extends Nette\Object
2
{
3
        private $foo;
4
5
        public function __construct($foo)
6
        {
7
                $this->foo = $foo;
8
        }
9
10
	protected function buildBaseForm()
11
	{
12-
                $form = new Form;
12+
		$form = new Form;
13
                // zakladni prvky
14
		return $form;
15
	}
16
17
        public function createForm()
18
        {
19
                $form = $this->buildBaseForm();
20
21
                $form->addSubmit('send', 'Update Account');
22
                $form->addSubmit('sendandview', 'Update Account and continue editing')
23
                        ->onClick[] = $this->process;
24-
		$form = $this->createForm();
24+
25
                return $form;
26
        }
27
28
	public function createAdminForm()
29
	{
30
		$form = $this->buildBaseForm();
31
		$form->addPassword();
32
33
                $form->addSubmit('send', 'Update Account');
34
                $form->addSubmit('sendandview', 'Update Account and continue editing')
35
                        ->onClick[] = $this->process;
36
37
		return $form;
38
	}
39
40
        public function process($button)
41
        {
42
                ...
43
        }
44
45
}