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


PHP Element::getLabelAttributes方法代碼示例

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


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

示例1: _getLabelAttr

 protected function _getLabelAttr(Element $element, $attr = array())
 {
     if (isset($attr['container'])) {
         return $this->_mergeAttributes(array($this->defaulLabelAttributes, $element->getLabelAttributes()));
     }
     return $this->defaulLabelAttributes;
 }
開發者ID:siad007,項目名稱:ctrllib,代碼行數:7,代碼來源:AbstractFormElement.php

示例2: setLabelClasses

 /**
  * Get the proper class for the label depending on the element type.
  * NOTE: This returns all the attributes for the element, not just the class
  *
  * @param Element $element
  * @return array
  */
 public function setLabelClasses(Element $element)
 {
     $labelAttributes = $element->getLabelAttributes();
     $controlClass = '';
     //If the class attribute is not set, set an empty one to avoid errors later
     if (!isset($labelAttributes['class'])) {
         $labelAttributes['class'] = '';
     }
     //Radio elements are special. The group of elements can have a control label & each individual element can have
     //it's own label. So we set the control label here and use
     if ($this->isControl($element) || $this->isRadio($element)) {
         $controlClass = strstr($labelAttributes['class'], 'control-label') === false ? ' control-label' : '';
     } elseif ($this->isCheckbox($element)) {
         $controlClass = strstr($labelAttributes['class'], 'checkbox') === false ? ' checkbox' : '';
     }
     //Hidden elements don't have special classes in Bootstrap so no need to check for them
     $labelAttributes['class'] = trim($labelAttributes['class'] . $controlClass);
     return $labelAttributes;
 }
開發者ID:aramonc,項目名稱:zf2-form-view-helpers,代碼行數:26,代碼來源:ArcControlGroup.php

示例3: testLabelAttributesAreEmptyByDefault

 public function testLabelAttributesAreEmptyByDefault()
 {
     $element = new Element();
     $this->assertEquals(array(), $element->getLabelAttributes());
 }
開發者ID:pnaq57,項目名稱:zf2demo,代碼行數:5,代碼來源:ElementTest.php


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