TTemplateControl is the base class for all controls that use templates.
By default, a control template is assumed to be in a file under the same
directory with the control class file. They have the same file name and
different extension name. For template file, the extension name is ".tpl".
/** * Publish the default stylesheet file. */ public function onPreRender($param) { parent::onPreRender($param); if ($this->getEnableDefaultStyle()) { $url = $this->publishAsset($this->getDefaultStyle() . '.css'); $this->getPage()->getClientScript()->registerStyleSheetFile($url, $url); } }
/** * This method is invoked right after the control has loaded its state. * You can override this method to initialize data from the control state. * Parent implementation must be invoked. */ public function loadState() { parent::loadState(); $this->_controlsRequiringPostData = $this->getViewState('ControlsRequiringPostBack', array()); }
public function onLoad($param) { parent::onLoad($param); $this->validateSecurity(); }