当前位置: 首页>>代码示例>>PHP>>正文


PHP TWebControl::render方法代码示例

本文整理汇总了PHP中TWebControl::render方法的典型用法代码示例。如果您正苦于以下问题:PHP TWebControl::render方法的具体用法?PHP TWebControl::render怎么用?PHP TWebControl::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TWebControl的用法示例。


在下文中一共展示了TWebControl::render方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 /**
  * Renders the label.
  * It overrides the parent implementation by checking if an associated
  * control is visible or not. If not, the label will not be rendered.
  * @param THtmlWriter writer
  */
 public function render($writer)
 {
     if (($aid = $this->getForControl()) !== '') {
         if ($control = $this->findControl($aid)) {
             if ($control->getVisible(true)) {
                 $this->_forControl = $control->getClientID();
                 parent::render($writer);
             }
         } else {
             throw new TInvalidDataValueException('label_associatedcontrol_invalid', $aid);
         }
     } else {
         parent::render($writer);
     }
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:21,代码来源:TLabel.php

示例2: render

 public function render($writer)
 {
     $this->registerClientScript();
     parent::render($writer);
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:5,代码来源:TAccordion.php

示例3: render

 /**
  * Renders the menu, and itinitialize top parent nodes css.
  * @return string the rendering result
  */
 function render()
 {
     $page = $this->getPage();
     if ($this->getGenerateCss()) {
         $cssPath = rtrim($this->getCssDirectory(), '/\\') . '/';
         $cssPath = ltrim($cssPath);
         $this->cssFile = new CssStyleSheet();
         $this->cssFile->setFile($cssPath . $this->getID() . '.css');
         $scriptFile = $this->getID() . '.js';
         $jsScript = new JsScript();
         $jsScript->setFile($this->getJsDirectory() . '/' . $scriptFile);
     }
     $body = $this->getBodies();
     foreach ($body as $item) {
         if ($item instanceof TCssDropDownMenuNode) {
             if ($item->getAlign() == null || $item->getAlign() == '') {
                 $item->setAlign($this->getAlign());
             }
             $item->setTopParent(true);
             $item->setTopParentNodeCssClass($this->getTopParentNodeCssClass());
             $item->setParentNodeCssClass($this->getParentNodeCssClass());
             $item->setNodeCssClass($this->getNodeCssClass());
             $item->setDisabledNodeCssClass($this->getDisabledCssClass());
             if ($this->getHeadingWidth() != null || $this->getHeadingWidth() != '') {
                 if ($item->getSubMenuWidth() == null || $item->getSubMenuWidth() == '') {
                     $item->setSubMenuWidth($this->getHeadingWidth());
                 }
             }
             $item->setLevel(1);
             if (!$this->isEnabled()) {
                 $item->setEnabled(false);
             }
             if ($this->getGenerateCss()) {
                 $item->setCssFile($this->cssFile);
                 $item->setJsFile($jsScript);
             }
             if ($this->getForeColor() != null || $this->getForeColor() != '') {
                 if ($item->getForeColor() == null || $item->getForeColor() == '') {
                     $item->setForeColor($item->getForeColor());
                 }
             }
             if ($this->getFontWeight() != null || $this->getFontWeight() != '') {
                 if ($item->getFontWeight() == null || $item->getFontWeight() == '') {
                     $item->setFontWeight($this->getFontWeight());
                 }
             }
         }
     }
     if ($this->getGenerateCss()) {
         $this->getCssAttributesToRender();
         //$cssStyleSheet->generateCss();
         if (!$page->isScriptFileRegistered('CssDropDownMenuJS')) {
             $scriptPath = rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/' . $this->getJsDirectory() . '/';
             $page->registerScriptFile('CssDropDownMenuJS', $scriptPath . $scriptFile);
             $page->registerStyleFile('CssDropDownMenuCss', $cssPath . $this->getID() . '.css');
         }
     } else {
         if (!$page->isScriptFileRegistered('CssDropDownMenuJS')) {
             $scriptPath = rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/' . $this->getJsDirectory() . '/';
             $cssPath = rtrim($this->getCssDirectory(), '/\\') . '/';
             $cssPath = ltrim($cssPath);
             if ($this->getHorizontal()) {
                 $cssFile = $this->getCssHorizontalFile();
             } else {
                 $cssFile = $this->getCssVerticalFile();
             }
             $scriptFile = $this->getJsFile();
             $page->registerStyleFile('CssDropDownMenuCSS', $cssPath . $cssFile);
             $page->registerScriptFile('CssDropDownMenuJS', $scriptPath . $scriptFile);
         }
     }
     $result = parent::render();
     if ($this->getGenerateCss()) {
         $jsScript->addElement($this->getID());
         $jsScript->generateJs();
         $this->cssFile->generateCss();
         $this->cssFile->close();
     }
     return $result;
 }
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:84,代码来源:TCssDropDownMenu.php

示例4: 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);
     }
 }
开发者ID:quantrocket,项目名称:planlogiq,代码行数:12,代码来源:TPager.php

示例5: render

 public function render($writer)
 {
     if ($this->getHasPreRendered()) {
         $this->setDisplay($this->getPageCount() == 1 ? TDisplayStyle::None : TDisplayStyle::Dynamic);
         TWebControl::render($writer);
         if ($this->getActiveControl()->canUpdateClientSide()) {
             $this->getPage()->getCallbackClient()->replaceContent($this, $writer);
         }
     } else {
         $this->getPage()->getAdapter()->registerControlToRender($this, $writer);
     }
 }
开发者ID:bailey-ann,项目名称:stringtools,代码行数:12,代码来源:TActivePager.php

示例6: render

 public function render($writer)
 {
     parent::render($writer);
     if (($butt = $this->getDefaultButton()) !== '') {
         if (($button = $this->findControl($butt)) === null) {
             throw new TInvalidDataValueException('panel_defaultbutton_invalid', $butt);
         } else {
             $this->getPage()->getClientScript()->registerDefaultButton($this, $button);
         }
     }
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:11,代码来源:TPanel.php

示例7: render

 /**
  * Renders the menu item.
  * @return string the rendering result
  */
 function render()
 {
     $content = parent::render();
     $content .= "\n";
     $user = $this->getPage()->getUser();
     if (!is_null($user)) {
         if (!$user->isInRole($this->getRoles())) {
             $content = '';
         }
     }
     return $content;
 }
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:16,代码来源:TCssDropDownMenuNode.php

示例8: render

 /**
  * Renders the body content of the control.
  * This method overrides the parent's implementation.
  * @return string the rendering result.
  */
 public function render()
 {
     $rendered = parent::render();
     $text = $this->isEncodeText() ? pradoEncodeData($this->getText()) : $this->getText();
     if (strlen($text)) {
         $name = $this->getUniqueID();
         $label = "<label for=\"{$name}\">{$text}</label>";
         if ($this->getTextAlign() == 'Left') {
             $rendered = $label . $rendered;
         } else {
             $rendered = $rendered . $label;
         }
     }
     return $rendered;
 }
开发者ID:BackupTheBerlios,项目名称:php5cms-svn,代码行数:20,代码来源:TCheckBox.php

示例9: render

 public function render()
 {
     $maxSize = $this->getMaxFileSize();
     if (!empty($maxSize)) {
         $this->getPage()->registerHiddenField('MAX_FILE_SIZE', $maxSize);
     }
     return parent::render();
 }
开发者ID:BackupTheBerlios,项目名称:php5cms-svn,代码行数:8,代码来源:TFileUpload.php


注:本文中的TWebControl::render方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。