当前位置: 首页>>代码示例>>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;未经允许,请勿转载。