Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function initialize() |
||
22 | { |
||
23 | $id = new Text("id"); |
||
24 | $id->addValidator(new PresenceOf(array( |
||
25 | 'message' => 'ID can not be empty.' |
||
26 | ))); |
||
27 | $id->addValidator(new Regex(array( |
||
28 | 'pattern' => '/[a-z0-9_-]+/i', |
||
29 | 'message' => 'В ID must be a-z 0-9 _ -' |
||
30 | ))); |
||
31 | $id->setLabel('ID'); |
||
32 | |||
33 | $title = new Text("title"); |
||
34 | $title->setLabel('Title'); |
||
35 | |||
36 | $html = new TextArea("html"); |
||
37 | $html->setLabel('HTML'); |
||
38 | |||
39 | $this->add($id); |
||
40 | $this->add($title); |
||
41 | $this->add($html); |
||
42 | |||
43 | } |
||
44 | |||
45 | } |