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


PHP Element::getAttribute方法代碼示例

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


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

示例1: renderLabel

 protected function renderLabel(Element $element)
 {
     $label = $element->getLabel();
     if (!empty($label)) {
         //echo '<label class="control-label" for="', $element->getAttribute("id"), '">';
         echo '<div class="rmfield" for="', $element->getAttribute("id"), '" style="', $element->getAttribute("labelstyle"), '"><label>';
         if ($element->isRequired()) {
             echo '<sup class="required">* </sup>';
         }
         echo $label, '</label></div>';
     }
 }
開發者ID:developmentDM2,項目名稱:What-The-Flicka,代碼行數:12,代碼來源:UserForm.php

示例2: resolveElementDuringFormLayoutRenderForListViewMerge

 /**
  * Resolve element during form layout render for list view merge
  * @param Element $element
  * @param string $preContentViewClass
  * @param array $selectedModels
  * @param RedBeanModel $primaryModel
  * @param string $modelAttributeAndElementDataToMergeItemClass
  */
 public static function resolveElementDuringFormLayoutRenderForListViewMerge(&$element, $preContentViewClass, $selectedModels, $primaryModel, $modelAttributeAndElementDataToMergeItemClass)
 {
     assert('is_string($preContentViewClass)');
     assert('is_array($selectedModels)');
     assert('$primaryModel instanceof RedBeanModel');
     assert('is_string($modelAttributeAndElementDataToMergeItemClass)');
     if ($element->getAttribute() != 'null') {
         $attributes = array($element->getAttribute());
     } else {
         $elementClassName = get_class($element);
         $attributes = $elementClassName::getModelAttributeNames();
     }
     $preContent = Yii::app()->getController()->widget($preContentViewClass, array('selectedModels' => $selectedModels, 'attributes' => $attributes, 'primaryModel' => $primaryModel, 'element' => $element, 'modelAttributeAndElementDataToMergeItemClass' => $modelAttributeAndElementDataToMergeItemClass), true);
     $element->editableTemplate = '<th>{label}</th><td colspan="{colspan}">' . $preContent . '{content}{error}</td>';
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:23,代碼來源:ListViewMergeUtil.php

示例3: addElement

 public function addElement(Element $element)
 {
     $element->setForm($this);
     //If the element doesn't have a specified id, a generic identifier is applied.
     $id = $element->getAttribute("id");
     $name = $element->getAttribute("name");
     if (empty($id) && $name) {
         $element->setAttribute("id", $name);
     } elseif (empty($id)) {
         $element->setAttribute("id", $this->attributes["id"] . "-element-" . sizeof($this->elements));
     }
     $this->elements[] = $element;
     /*For ease-of-use, the form tag's encytype attribute is automatically set if the File element
       class is added.*/
     if ($element instanceof Element\File) {
         $this->attributes["enctype"] = "multipart/form-data";
     }
 }
開發者ID:burakcakirel,項目名稱:form,代碼行數:18,代碼來源:Form.php

示例4: renderLabel

 protected function renderLabel(Element $element)
 {
     $label = $element->getLabel();
     if (!empty($label)) {
         echo '<label class="control-label" for="', $element->getAttribute("id"), '">';
         if ($element->isRequired()) {
             echo '<span class="required">* </span>';
         }
         echo $label, '</label>';
     }
 }
開發者ID:Kemitestech,項目名稱:WordPress-Skeleton,代碼行數:11,代碼來源:SideBySide.php

示例5: renderLabel

 protected function renderLabel(Element $element)
 {
     $label = $element->getLabel();
     if (empty($label)) {
         $label = '';
     }
     echo ' <label class="text-left-xs col-xs-12 col-md-4 control-label" for="', $element->getAttribute("id"), '">';
     if (!$this->noLabel && $element->isRequired()) {
         echo '<span class="required">* </span>';
     }
     echo $label, '</label> ';
 }
開發者ID:oytunistrator,項目名稱:php-bootstrap-form,代碼行數:12,代碼來源:SideBySide.php

示例6: getRelatedAttributeForDedupe

 /**
  * Return the related attribute that should be used to trigger the dedupe
  * @param Element $element
  * @return mixed
  */
 protected function getRelatedAttributeForDedupe(Element $element)
 {
     $dedupeMappingArray = $this->getDedupeAttributesAndRelatedAttributesMappedArray();
     return $dedupeMappingArray[$element->getAttribute()];
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:10,代碼來源:DedupeRules.php

示例7: addElement

 /**
  * Add an element to the array of elements we will be validating. Use the elements name as the array key for access
  * @param  $element
  * @return \fieldset 
  */
 public function addElement($element)
 {
     if (!$element instanceof ElementInterface) {
         if (!is_array($element)) {
             throw new \Exception('Element must be an array or interface ElementInterface');
         }
         $element = new Element($this->formbuilder, $element);
     }
     $this->_elements[$element->getAttribute('key') ?: $element->getName()] = $element;
     return $this;
 }
開發者ID:joegreen0991,項目名稱:laraform,代碼行數:16,代碼來源:Fieldset.php


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