3 * TControlAdapter class file.
5 * @author Qiang Xue <qiang.xue@gmail.com>
6 * @link https://github.com/pradosoft/prado
7 * @copyright Copyright © 2005-2016 The PRADO Group
8 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9 * @package System.Web.UI
13 * TControlAdapter class
15 * TControlAdapter is the base class for adapters that customize
16 * various behaviors for the control to which the adapter is attached.
18 * @author Qiang Xue <qiang.xue@gmail.com>
19 * @package System.Web.UI
22 class TControlAdapter extends TApplicationComponent
25 * @var TControl the control to which the adapter is attached
31 * @param TControl the control to which the adapter is attached
33 public function __construct($control)
35 $this->_control=$control;
39 * @return TControl the control to which this adapter is attached
41 public function getControl()
43 return $this->_control;
47 * @return TPage the page that contains the attached control
49 public function getPage()
51 return $this->_control?$this->_control->getPage():null;
55 * Creates child controls for the attached control.
56 * Default implementation calls the attached control's corresponding method.
58 public function createChildControls()
60 $this->_control->createChildControls();
64 * Loads additional persistent control state.
65 * Default implementation calls the attached control's corresponding method.
67 public function loadState()
69 $this->_control->loadState();
73 * Saves additional persistent control state.
74 * Default implementation calls the attached control's corresponding method.
76 public function saveState()
78 $this->_control->saveState();
82 * This method is invoked when the control enters 'OnInit' stage.
83 * Default implementation calls the attached control's corresponding method.
84 * @param TEventParameter event parameter to be passed to the event handlers
86 public function onInit($param)
88 $this->_control->onInit($param);
92 * This method is invoked when the control enters 'OnLoad' stage.
93 * Default implementation calls the attached control's corresponding method.
94 * @param TEventParameter event parameter to be passed to the event handlers
96 public function onLoad($param)
98 $this->_control->onLoad($param);
102 * This method is invoked when the control enters 'OnPreRender' stage.
103 * Default implementation calls the attached control's corresponding method.
104 * @param TEventParameter event parameter to be passed to the event handlers
106 public function onPreRender($param)
108 $this->_control->onPreRender($param);
112 * This method is invoked when the control enters 'OnUnload' stage.
113 * Default implementation calls the attached control's corresponding method.
114 * @param TEventParameter event parameter to be passed to the event handlers
116 public function onUnload($param)
118 $this->_control->onUnload($param);
122 * This method is invoked when the control renders itself.
123 * Default implementation calls the attached control's corresponding method.
124 * @param THtmlWriter writer for the rendering purpose
126 public function render($writer)
128 $this->_control->render($writer);
132 * Renders the control's children.
133 * Default implementation calls the attached control's corresponding method.
134 * @param THtmlWriter writer for the rendering purpose
136 public function renderChildren($writer)
138 $this->_control->renderChildren($writer);