本文整理汇总了PHP中TWebControl::onPreRender方法的典型用法代码示例。如果您正苦于以下问题:PHP TWebControl::onPreRender方法的具体用法?PHP TWebControl::onPreRender怎么用?PHP TWebControl::onPreRender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TWebControl
的用法示例。
在下文中一共展示了TWebControl::onPreRender方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onPreRender
/**
* Registers CSS and JS.
* This method is invoked right before the control rendering, if the control is visible.
* @param mixed event parameter
*/
public function onPreRender($param)
{
parent::onPreRender($param);
if ($this->getPage()->getClientSupportsJavaScript()) {
$this->registerStyleSheet();
$this->registerClientScript();
}
}
示例2: onPreRender
/**
* Registers the checkbox to receive postback data during postback.
* This is necessary because a checkbox if unchecked, when postback,
* does not have direct mapping between post data and the checkbox name.
*
* This method overrides the parent implementation and is invoked before render.
* @param mixed event parameter
*/
public function onPreRender($param)
{
parent::onPreRender($param);
if ($this->getEnabled(true)) {
$this->getPage()->registerRequiresPostData($this);
}
}
示例3: onPreRender
/**
* Registers CSS and JS.
* This method is invoked right before the control rendering, if the control is visible.
* @param mixed event parameter
*/
public function onPreRender($param)
{
parent::onPreRender($param);
$this->getActiveView();
// determine the active view
$this->registerStyleSheet();
}
示例4: onPreRender
/**
* Sets Enctype of the form on the page.
* This method overrides the parent implementation and is invoked before render.
* @param mixed event parameter
*/
public function onPreRender($param)
{
parent::onPreRender($param);
if (($form = $this->getPage()->getForm()) !== null) {
$form->setEnctype('multipart/form-data');
}
$this->getPage()->getClientScript()->registerHiddenField('MAX_FILE_SIZE', $this->getMaxFileSize());
if ($this->getEnabled(true)) {
$this->getPage()->registerRequiresPostData($this);
}
}
示例5: onPreRender
/**
* Performs databinding to populate data items from data source.
* This method is invoked by {@link dataBind()}.
* You may override this function to provide your own way of data population.
* @param Traversable the bound data
*/
public function onPreRender($param)
{
parent::onPreRender($param);
$controlID = $this->getControlToPaginate();
if (($targetControl = $this->getNamingContainer()->findControl($controlID)) === null || !$targetControl instanceof TDataBoundControl) {
throw new TConfigurationException('pager_controltopaginate_invalid', $controlID);
}
if ($targetControl->getAllowPaging()) {
$this->_pageCount = $targetControl->getPageCount();
$this->getControls()->clear();
$this->setPageCount($targetControl->getPageCount());
$this->setCurrentPageIndex($targetControl->getCurrentPageIndex());
$this->buildPager();
} else {
$this->_pageCount = 0;
}
}
示例6: onPreRender
/**
* Registers CSS and JS.
* This method is invoked right before the control rendering, if the control is visible.
* @param mixed event parameter
*/
public function onPreRender($param)
{
parent::onPreRender($param);
$this->registerStyleSheet();
$this->registerSliderClientScript();
}
示例7: onPreRender
/**
* Ensures any pending databind is performed.
* This method overrides the parent implementation.
* @param TEventParameter event parameter
*/
public function onPreRender($param)
{
$this->_prerendered = true;
$this->ensureDataBound();
parent::onPreRender($param);
}
示例8: onPreRender
/**
* Overrides parent implementation by registering necessary Javascripts for validation.
* @param TEventParameter the event parameter
*/
public function onPreRender($param)
{
parent::onPreRender($param);
$page = $this->getPage();
if ($this->isClientScriptEnabled() && !$page->isScriptFileRegistered('validator')) {
$dependencies = array('base', 'dom', 'validator');
$path = $this->Application->getResourceLocator()->getJsPath() . '/';
foreach ($dependencies as $file) {
$page->registerScriptFile($file, $path . $file . '.js');
}
$script = "\n\t\t\tif(typeof(Prado) == 'undefined')\n\t\t\t\talert(\"Unable to find Prado javascript library '{$path}base.js'.\");\n\t\t\telse if(Prado.Version != 2.0) \n\t\t\t\talert(\"Prado javascript library version 2.0 required.\");\n\t\t\telse if(typeof(Prado.Validation) == 'undefined')\n\t\t\t\talert(\"Unable to find validation javascript library '{$path}validator.js'.\");\t\t\t\t\n\t\t\telse\n\t\t\t\tPrado.Validation.AddForm('{$page->Form->ClientID}');\t\t\t\t\n\t\t\t";
$page->registerEndScript('TValidator', $script);
}
//update the Css class for the controls
$idPath = $this->getControlToValidate();
if (strlen($idPath)) {
$this->updateControlCssClass($this->getTargetControl($idPath));
}
}
示例9: onPreRender
/**
* Checks for API keys
* @param mixed event parameter
*/
public function onPreRender($param)
{
parent::onPreRender($param);
if ("" == $this->getPublicKey()) {
throw new TConfigurationException('recaptcha_publickey_unknown');
}
if ("" == $this->getPrivateKey()) {
throw new TConfigurationException('recaptcha_privatekey_unknown');
}
// need to register captcha fields so they will be sent back also in callbacks
$page = $this->getPage();
$page->registerRequiresPostData($this->getChallengeFieldName());
$page->registerRequiresPostData($this->getResponseFieldName());
}
示例10: onPreRender
/**
* Registers CSS and JS.
* This method is invoked right before the control rendering, if the control is visible.
* @param mixed event parameter
*/
public function onPreRender($param)
{
parent::onPreRender($param);
$this->getActiveView();
// determine the active view
$this->registerStyleSheet();
$page = $this->getPage();
$page->registerRequiresPostData($this);
$page->registerRequiresPostData($this->getClientID() . "_1");
}
示例11: onPreRender
public function onPreRender($writer)
{
parent::onPreRender($writer);
$this->registerClientScripts();
}
示例12: onPreRender
public function onPreRender($param)
{
parent::onPreRender($param);
if (!$this->getPage()->getIsCallback()) {
$this->registerStyleSheet();
$this->registerClientScript();
}
}