summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/LabeledTextBox2/LabeledTextBox.php
blob: 5bbf4ce2767b76d587e6c53fd1a87c9e19d73668 (plain)
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
<?php

class LabeledTextBox extends TCompositeControl
{
	private $_label;
	private $_textbox;

	protected function createChildControls()
	{
		$this->_label=new TLabel;
		$this->_label->setID('Label');
		$this->getControls()->add($this->_label);
		$this->getControls()->add('&nbsp;');
		$this->_textbox=new TTextBox;
		$this->_textbox->setID('TextBox');
		$this->_label->setForControl('TextBox');
		$this->getControls()->add($this->_textbox);
	}

	public function getLabel()
	{
		$this->ensureChildControls();
		return $this->_label;
	}

	public function getTextBox()
	{
		$this->ensureChildControls();
		return $this->_textbox;
	}
}

?>