本文整理汇总了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>';
}
}
示例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>';
}
示例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";
}
}
示例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>';
}
}
示例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> ';
}
示例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()];
}
示例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;
}