當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TWebControl::getAttributesToRender方法代碼示例

本文整理匯總了PHP中TWebControl::getAttributesToRender方法的典型用法代碼示例。如果您正苦於以下問題:PHP TWebControl::getAttributesToRender方法的具體用法?PHP TWebControl::getAttributesToRender怎麽用?PHP TWebControl::getAttributesToRender使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TWebControl的用法示例。


在下文中一共展示了TWebControl::getAttributesToRender方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAttributesToRender

 /**
  * Returns the attributes to be rendered.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     unset($attributes['id']);
     return $attributes;
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:10,代碼來源:TDataListItem.php

示例2: getAttributesToRender

 /**
  * This overrides the parent implementation by rendering more THyperLink-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attr = parent::getAttributesToRender();
     $href = $this->getNavigateUrl();
     if (strlen($href) && $this->isEnabled()) {
         $attr['href'] = pradoEncodeData($href);
     }
     $target = $this->getTarget();
     if (strlen($target)) {
         $attr['target'] = $target;
     }
     return $attr;
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:17,代碼來源:THyperLink.php

示例3: getAttributesToRender

 /**
  * This overrides the parent implementation by rendering more TLinkButton-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attr = parent::getAttributesToRender();
     if ($this->isEnabled()) {
         $page = $this->getPage();
         $postBack = $page->getPostBackClientEvent($this, '');
         if ($this->causesValidation() && $this->Page->isEndScriptRegistered('TValidator')) {
             $script = "Prado.Validation.AddTarget('{$this->ClientID}');";
             $this->Page->registerEndScript($this->ClientID . 'target', $script);
         }
         $attr['href'] = "javascript:{$postBack}";
     }
     return $attr;
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:18,代碼來源:TLinkButton.php

示例4: getAttributesToRender

 /**
  * Returns the attributes to be rendered.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $url = $this->getBackImageUrl();
     if (strlen($url)) {
         $this->setStyle(array('background-image' => "url({$url})"));
     }
     $attributes = parent::getAttributesToRender();
     if (($cellSpacing = $this->getCellSpacing()) >= 0) {
         $attributes['cellspacing'] = $cellSpacing;
     } else {
         $attributes['cellspacing'] = '0';
     }
     if (($cellPadding = $this->getCellPadding()) >= 0) {
         $attributes['cellpadding'] = $cellPadding;
     } else {
         $attributes['cellpadding'] = '0';
     }
     $grid = $this->getGridLines();
     if ($grid != 'None') {
         if ($grid == 'Horizontal') {
             $attributes['rules'] = 'rows';
         } else {
             if ($grid == 'Both') {
                 $attributes['rules'] = 'all';
             } else {
                 if ($grid == 'Vertical') {
                     $attributes['rules'] = 'cols';
                 }
             }
         }
         if (!isset($attributes['border'])) {
             $attributes['border'] = '1';
         }
     }
     $align = $this->getHorizontalAlign();
     if ($align != 'NotSet') {
         $attributes['align'] = $align;
     }
     return $attributes;
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:44,代碼來源:TTable.php

示例5: getAttributesToRender

 /**
  * Returns the attributes to be rendered.
  * This method overrides the parent's implementation.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes['name'] = $this->getUniqueID();
     if ($this->isReadOnly()) {
         $attributes['readonly'] = 'readonly';
     }
     if ($this->isAutoPostBack()) {
         $page = $this->getPage();
         $script = $page->getPostBackClientEvent($this, '');
         $attributes['onchange'] = "javascript:{$script}";
     }
     $type = $this->getTextMode();
     if ($type === 'MultiLine') {
         if (($rows = $this->getRows()) > 0) {
             $attributes['rows'] = $rows;
         }
         if (($cols = $this->getColumns()) > 0) {
             $attributes['cols'] = $cols;
         }
         if (!$this->isWrap()) {
             $attributes['wrap'] = 'off';
         }
     } else {
         $attributes['type'] = $type === 'Password' ? 'password' : 'text';
         if (($cols = $this->getColumns()) > 0) {
             $attributes['size'] = $cols;
         }
         if (($maxLength = $this->getMaxLength()) > 0) {
             $attributes['maxlength'] = $maxLength;
         }
         $attributes['value'] = $this->isEncodeText() ? pradoEncodeData($this->getText()) : $this->getText();
     }
     return $attributes;
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:40,代碼來源:TTextBox.php

示例6: getAttributesToRender

 /**
  * This overrides the parent implementation by rendering more TWebControl-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     if ($this->getGenerateCss()) {
         unset($attributes['style']);
     }
     if (!$this->isEnabled()) {
         $attributes['disabled'] = "disabled";
     }
     $tabIndex = $this->getTabIndex();
     if (!empty($tabIndex)) {
         $attributes['tabindex'] = $tabIndex;
     }
     $toolTip = $this->getToolTip();
     if (strlen($toolTip)) {
         $attributes['title'] = $toolTip;
     }
     $accessKey = $this->getAccessKey();
     if (strlen($accessKey)) {
         $attributes['accesskey'] = $accessKey;
     }
     $cssClass = $this->getCssClass();
     if (strlen($cssClass)) {
         $attributes['class'] = $cssClass;
     }
     return $attributes;
 }
開發者ID:BackupTheBerlios,項目名稱:flushcms,代碼行數:31,代碼來源:TCssDropDownMenu.php

示例7: getAttributesToRender

 /**
  * Returns the attributes to be rendered.
  * This method overrides the parent's implementation.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes["id"] = $this->getClientID();
     $attributes["type"] = "checkbox";
     $attributes["name"] = $this->getClientID();
     if ($this->isChecked()) {
         $attributes["checked"] = "checked";
     }
     if (!$this->isEnabled()) {
         $attributes["disabled"] = "disabled";
     }
     if ($this->isAutoPostBack()) {
         $page = $this->getPage();
         $script = $page->getPostBackClientEvent($this, '');
         $attributes["onclick"] = "javascript:{$script}";
     }
     $accessKey = $this->getAccessKey();
     if (strlen($accessKey)) {
         $attributes["acesskey"] = $accessKey;
     }
     $tabIndex = $this->getTabIndex();
     if (!empty($tabIndex)) {
         $attributes["tabindex"] = $tabIndex;
     }
     return $attributes;
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:32,代碼來源:TCheckBox.php

示例8: getAttributesToRender

 /**
  * This overrides the parent implementation by rendering more TImage-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes['src'] = $this->getImageUrl();
     $attributes['border'] = $this->getBorder();
     $attributes['alt'] = $this->isEncodeText() ? pradoEncodeData($this->getAlternateText()) : $this->getAlternateText();
     $align = $this->getImageAlign();
     if (strlen($align)) {
         $attributes['align'] = $align;
     }
     return $attributes;
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:16,代碼來源:TImage.php

示例9: getAttributesToRender

 /**
  * This overrides the parent implementation by rendering more TButton-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes['type'] = "submit";
     $attributes['name'] = $this->getUniqueID();
     $attributes['value'] = $this->isEncodeText() ? pradoEncodeData($this->getText()) : $this->getText();
     if ($this->causesValidation() && $this->Page->isEndScriptRegistered('TValidator')) {
         $script = "Prado.Validation.AddTarget('{$this->ClientID}');";
         $this->Page->registerEndScript($this->ClientID . 'target', $script);
     }
     return $attributes;
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:16,代碼來源:TButton.php

示例10: getAttributesToRender

 /**
  * This overrides the parent implementation by rendering the FOR
  * attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attr = parent::getAttributesToRender();
     $forID = $this->getForID();
     $parent = $this->getParent();
     $for = $parent->findObject($forID);
     if (is_null($for)) {
         throw new Exception("Invalid \"For\" attribute in TFormLabel value: {$forID}.");
     } else {
         if ($for instanceof TListControl) {
             if (isset($attr['onclick'])) {
                 $onclick = explode(';', $attr['onclick']);
             }
             $onclick[] = 'document.getElementById(\'' . $for->getClientID() . '\').focus();return false;';
             $attr['onclick'] = implode(';', $onclick);
         }
         $attr['for'] = $for->getClientID();
     }
     return $attr;
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:25,代碼來源:TFormLabel.php

示例11: getAttributesToRender

 /**
  * Returns the attributes to be rendered.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $align = $this->getHorizontalAlign();
     if ($align != 'NotSet') {
         $attributes['align'] = strtolower($align);
     }
     $valign = $this->getVerticalAlign();
     if ($valign != 'NotSet') {
         $attributes['valign'] = strtolower($valign);
     }
     unset($attributes['id']);
     return $attributes;
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:18,代碼來源:TTableRow.php

示例12: getAttributesToRender

 /**
  * Returns the attributes to be rendered.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     if (($colspan = $this->getColumnSpan()) > 0) {
         $attributes['colspan'] = $colspan;
     }
     if (($rowspan = $this->getRowSpan()) > 0) {
         $attributes['rowspan'] = $rowspan;
     }
     if (!$this->isWrap()) {
         $attributes['nowrap'] = 'nowrap';
     }
     $align = $this->getHorizontalAlign();
     if ($align != 'NotSet') {
         $attributes['align'] = strtolower($align);
     }
     $valign = $this->getVerticalAlign();
     if ($valign != 'NotSet') {
         $attributes['valign'] = strtolower($valign);
     }
     unset($attributes['id']);
     return $attributes;
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:27,代碼來源:TTableCell.php

示例13: getAttributesToRender

 /**
  * This overrides the parent implementation by rendering more TPanel-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $url = $this->getBackImageUrl();
     if (strlen($url)) {
         $this->setStyle(array('background-image' => "url({$url})"));
     }
     $attributes = parent::getAttributesToRender();
     $align = $this->getHorizontalAlign();
     if (strlen($align)) {
         $attributes['align'] = $align;
     }
     if (!$this->isWrap()) {
         $attributes['nowrap'] = 'nowrap';
     }
     return $attributes;
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:20,代碼來源:TPanel.php

示例14: getAttributesToRender

 /**
  * This overrides the parent implementation by rendering more TButton-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes['type'] = 'file';
     $attributes['name'] = $this->getUniqueID();
     return $attributes;
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:11,代碼來源:TFileUpload.php

示例15: getAttributesToRender

 /**
  * This overrides the parent implementation by rendering more TButton-specific attributes.
  * @return ArrayObject the attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     $attributes['type'] = 'file';
     $attributes['name'] = $this->getUniqueID();
     if (($cols = $this->getColumns()) > 0) {
         $attributes['size'] = $cols;
     }
     return $attributes;
 }
開發者ID:joybinchen,項目名稱:svnmanager-1.09,代碼行數:14,代碼來源:TFileUpload.php


注:本文中的TWebControl::getAttributesToRender方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。