本文整理汇总了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);
}
}
示例2: render
public function render($writer)
{
$this->registerClientScript();
parent::render($writer);
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例9: render
public function render()
{
$maxSize = $this->getMaxFileSize();
if (!empty($maxSize)) {
$this->getPage()->registerHiddenField('MAX_FILE_SIZE', $maxSize);
}
return parent::render();
}