本文整理汇总了PHP中TWebControl类的典型用法代码示例。如果您正苦于以下问题:PHP TWebControl类的具体用法?PHP TWebControl怎么用?PHP TWebControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TWebControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: copyBaseAttributes
/**
* Copies basic control attributes from another control.
* Properties including AccessKey, ToolTip, TabIndex, Enabled
* and Attributes are copied.
* @param TWebControl source control
*/
public function copyBaseAttributes(TWebControl $control)
{
$this->setAccessKey($control->getAccessKey());
$this->setToolTip($control->getToolTip());
$this->setTabIndex($control->getTabIndex());
if (!$control->getEnabled()) {
$this->setEnabled(false);
}
if ($control->getHasAttributes()) {
$this->getAttributes()->copyFrom($control->getAttributes());
}
}
示例2: renderRepeater
/**
* Renders the repeated items.
* @param THtmlWriter writer for the rendering purpose
* @param IRepeatInfoUser repeat information user
*/
public function renderRepeater($writer, IRepeatInfoUser $user)
{
if ($this->_repeatLayout === TRepeatLayout::Table) {
$control = new TTable();
if ($this->_caption !== '') {
$control->setCaption($this->_caption);
$control->setCaptionAlign($this->_captionAlign);
}
} else {
if ($this->_repeatLayout === TRepeatLayout::Raw) {
$this->renderRawContents($writer, $user);
return;
} else {
$control = new TWebControl();
}
}
$control->setID($user->getClientID());
$control->copyBaseAttributes($user);
if ($user->getHasStyle()) {
$control->getStyle()->copyFrom($user->getStyle());
}
$control->renderBeginTag($writer);
$writer->writeLine();
if ($this->_repeatDirection === TRepeatDirection::Vertical) {
$this->renderVerticalContents($writer, $user);
} else {
$this->renderHorizontalContents($writer, $user);
}
$control->renderEndTag($writer);
}
示例3: addAttributesToRender
/**
* Ensure that the ID attribute is rendered and registers the javascript code
* for initializing the active control.
*/
protected function addAttributesToRender($writer)
{
//calls the TWebControl to avoid rendering other attribute normally render for a textbox.
TWebControl::addAttributesToRender($writer);
$writer->addAttribute('id', $this->getLabelClientID());
$this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions());
}
示例4: renderContents
/**
* Renders the body content of the label.
* @param THtmlWriter the renderer
*/
public function renderContents($writer)
{
if (($text = $this->getText()) === '') {
parent::renderContents($writer);
} else {
$writer->write($text);
}
}
示例5: renderContents
/**
* Renders body content.
* This method overrides the parent implementation by replacing
* the body content with the processed text content.
* @param THtmlWriter writer
*/
public function renderContents($writer)
{
if (($text = $this->getText()) === '' && $this->getHasControls()) {
$textWriter = new TTextWriter();
parent::renderContents(new THtmlWriter($textWriter));
$text = $textWriter->flush();
}
if ($text !== '') {
$writer->write($this->processText($text));
}
}
示例6: renderContents
/**
* Renders body content.
* This method overrides the parent implementation by replacing
* the body content with the processed text content.
* @param THtmlWriter writer
*/
public function renderContents($writer)
{
if (($text = $this->getText()) === '' && $this->getHasControls()) {
$htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
parent::renderContents($htmlWriter);
$text = $htmlWriter->flush();
}
if ($text !== '') {
$writer->write($this->processText($text));
}
}
示例7: addAttributesToRender
/**
* Adds attributes related to an HTML image element to renderer.
* @param THtmlWriter the writer used for the rendering purpose
*/
protected function addAttributesToRender($writer)
{
$writer->addAttribute('src', $this->getImageUrl());
$writer->addAttribute('alt', $this->getAlternateText());
if (($desc = $this->getDescriptionUrl()) !== '') {
$writer->addAttribute('longdesc', $desc);
}
if (($align = $this->getImageAlign()) !== '') {
$writer->addAttribute('align', $align);
}
parent::addAttributesToRender($writer);
}
示例8: renderContents
/**
* Renders the body content of the hyperlink.
* @param THtmlWriter the writer for rendering
*/
public function renderContents($writer)
{
if (($imageUrl = $this->getImageUrl()) === '') {
if (($text = $this->getText()) !== '') {
$writer->write(THttpUtility::htmlEncode($text));
} else {
if ($this->getHasControls()) {
parent::renderContents($writer);
} else {
$writer->write(THttpUtility::htmlEncode($this->getNavigateUrl()));
}
}
} else {
$this->createImage($imageUrl)->renderControl($writer);
}
}
示例9: addAttributesToRender
/**
* Adds attribute name-value pairs to renderer.
* This overrides the parent implementation with additional button specific attributes.
* @param THtmlWriter the writer used for the rendering purpose
*/
protected function addAttributesToRender($writer)
{
$page = $this->getPage();
$page->ensureRenderInForm($this);
if (($uniqueID = $this->getUniqueID()) !== '') {
$writer->addAttribute('name', $uniqueID);
}
if ($this->getEnabled(true)) {
if ($this->getEnableClientScript() && $this->needPostBackScript()) {
$this->renderClientControlScript($writer);
}
} else {
if ($this->getEnabled()) {
// in this case, parent will not render 'disabled'
$writer->addAttribute('disabled', 'disabled');
}
}
parent::addAttributesToRender($writer);
}
示例10: render
/**
* Renders the control.
* The method overrides the parent implementation by rendering
* the pager only when there are two or more pages.
* @param THtmlWriter the writer
*/
public function render($writer)
{
if ($this->_pageCount > 1) {
parent::render($writer);
}
}
示例11: renderContents
public function renderContents($writer)
{
parent::renderContents($writer);
}
示例12: onInit
/**
* Creates the child controls of the wizard.
* This method overrides the parent implementation.
* @param TEventParameter event parameter
*/
public function onInit($param)
{
parent::onInit($param);
$this->ensureChildControls();
$this->setEnsureId(true);
if ($this->getActiveStepIndex() < 0 && $this->getWizardSteps()->getCount() > 0) {
$this->setActiveStepIndex(0);
}
}
示例13: renderBody
/**
* Renders the body content of this table.
* @return string the rendering result
*/
protected function renderBody()
{
return "\n" . parent::renderBody() . "\n";
}
示例14: renderBeginTag
/**
* Renders the openning tag for the table control which will render table caption if present.
* @param THtmlWriter the writer used for the rendering purpose
*/
public function renderBeginTag($writer)
{
parent::renderBeginTag($writer);
if (($caption = $this->getCaption()) !== '') {
if (($align = $this->getCaptionAlign()) !== TTableCaptionAlign::NotSet) {
$writer->addAttribute('align', strtolower($align));
}
$writer->renderBeginTag('caption');
$writer->write($caption);
$writer->renderEndTag();
}
}
示例15: 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);
}
}