summaryrefslogtreecommitdiff
path: root/lib/prado/framework/Web/UI/WebControls/TWebControlAdapter.php
blob: 2ec976b1282808290a4774804806db8efe7218d5 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
 * TWebControlAdapter class file.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @link https://github.com/pradosoft/prado
 * @copyright Copyright &copy; 2005-2016 The PRADO Group
 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
 * @package System.Web.UI.WebControls
 */

/**
 * TWebControlAdapter class
 *
 * TWebControlAdapter is the base class for adapters that customize
 * rendering for the Web control to which the adapter is attached.
 * It may be used to modify the default markup or behavior for specific
 * browsers.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @package System.Web.UI.WebControls
 * @since 3.0
 */
class TWebControlAdapter extends TControlAdapter
{
	/**
	 * Renders the control to which the adapter is attached.
	 * It calls {@link renderBeginTag}, {@link renderContents} and
	 * {@link renderEndTag} in order.
	 * @param THtmlWriter writer for the rendering purpose
	 */
	public function render($writer)
	{
		$this->renderBeginTag($writer);
		$this->renderContents($writer);
		$this->renderEndTag($writer);
	}

	/**
	 * Renders the openning tag for the attached control.
	 * Default implementation calls the attached control's corresponding method.
	 * @param THtmlWriter writer for the rendering purpose
	 */
	public function renderBeginTag($writer)
	{
		$this->getControl()->renderBeginTag($writer);
	}

	/**
	 * Renders the body contents within the attached control tag.
	 * Default implementation calls the attached control's corresponding method.
	 * @param THtmlWriter writer for the rendering purpose
	 */
	public function renderContents($writer)
	{
		$this->getControl()->renderContents($writer);
	}

	/**
	 * Renders the closing tag for the attached control.
	 * Default implementation calls the attached control's corresponding method.
	 * @param THtmlWriter writer for the rendering purpose
	 */
	public function renderEndTag($writer)
	{
		$this->getControl()->renderEndTag($writer);
	}
}