-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput.comp.class.php
More file actions
55 lines (45 loc) · 926 Bytes
/
input.comp.class.php
File metadata and controls
55 lines (45 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* コンポーネント
*/
class NyaaFormInputComp extends NyaaFormInput
{
public $template = ':html';
public $from = '1980-01-01';
public $to = '1982-12-01';
public $parseFormat = '([0-9]+)-([0-9]+)-([0-9]+)';
public function __construct( )
{
$this->to = date('Y-m-d');
}
function setChild( $child )
{
$this->child = $child;
}
function setLayout( $layout )
{
$this->layout = $layout;
}
function setLayout_start( $layout )
{
$this->layout_start = $layout;
}
function setLayout_end( $layout )
{
$this->layout_end = $layout;
}
function toHtml( )
{
$html= $this->layout_start;
foreach($this->child as $k=>$v)
{
$e = $this->factory(array_merge(array('name'=>$k), $v));
$main = preg_replace('/%html/',$e->toHtml(), $this->layout);
$main = preg_replace('/%label/',$e->toLabel(), $main);
$html .= $main;
}
$html .= $this->layout_end;
return $html;
}
}
?>