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


PHP Widget::getAttributes方法代碼示例

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


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

示例1: getAttributes

 function getAttributes()
 {
     $attributes = parent::getAttributes();
     if ($this->multiple) {
         $attributes["name"] .= "[]";
     }
     return $attributes;
 }
開發者ID:phpalchemy,項目名稱:phpalchemy,代碼行數:8,代碼來源:Listbox.php

示例2: generate

 /**
  * Parse the template
  *
  * @return string
  */
 public function generate()
 {
     $this->Template = new \FrontendTemplate($this->strTemplate);
     $this->Template->field = $this->objWidget;
     $this->Template->attributes = $this->objWidget->getAttributes();
     $this->Template->tagEnding = $this->strTagEnding;
     $this->Template->hideLabel = $this->hideLabel || $this->objWidget->hideLabel;
     $this->Template->explanation = $this->explanation || $this->objWidget->explanation;
     $this->Template->invisible = $this->invisible || $this->objWidget->invisible;
     $this->Template->help = $this->parseHelp();
     $this->setCssClasses();
     $this->setGroupCssClasses();
     $this->compile();
     $this->Template->class = $this->getCssClasses();
     $this->Template->groupClass = $this->getGroupCssClasses();
     $this->Template->attributes = $this->objWidget->getAttributes();
     $this->Template->placeholder = $this->parsePlaceholder();
     return $this->Template->parse();
 }
開發者ID:heimrichhannot,項目名稱:contao-bootstrapper,代碼行數:24,代碼來源:BootstrapperFormField.php

示例3: getAttributes

 /**
  * Return all attributes as string
  *
  * @param array $arrStrip An optional array with attributes to strip
  *
  * @return string The attributes string
  */
 public function getAttributes($arrStrip = array())
 {
     // The "required" attribute only makes sense for single checkboxes
     if (count($this->arrOptions) == 1 && $this->mandatory) {
         $this->arrAttributes['required'] = 'required';
     }
     return parent::getAttributes($arrStrip);
 }
開發者ID:qzminski,項目名稱:contao-core-bundle,代碼行數:15,代碼來源:FormCheckBox.php

示例4: getAttributes

 /**
  * Return all attributes as string
  *
  * @param array $arrStrip An optional array with attributes to strip
  *
  * @return string The attributes string
  */
 public function getAttributes($arrStrip = array())
 {
     /** @var \PageModel $objPage */
     global $objPage;
     $arrStrip = array();
     // XHTML does not support maxlength
     if ($objPage->outputFormat == 'xhtml') {
         $arrStrip[] = 'maxlength';
     }
     return parent::getAttributes($arrStrip);
 }
開發者ID:bytehead,項目名稱:contao-core,代碼行數:18,代碼來源:FormTextArea.php


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