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".
Since: 3.0
Author: Qiang Xue (qiang.xue@gmail.com)
Inheritance: extends TCompositeControl
Example #1
0
 /**
  * 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);
     }
 }
Example #2
0
 /**
  * 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());
 }
Example #3
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $this->validateSecurity();
 }