Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add 'setInputsAttribute' method for all form element classes.
  • Loading branch information
joyqi committed Sep 3, 2019
1 parent 32c2f82 commit 147f7ed
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions var/Typecho/Widget/Helper/Form/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,17 @@ public function addRule($name)
$this->rules[] = func_get_args();
return $this;
}

/**
* 统一设置所有输入项的属性值
*
* @param $attributeName
* @param $attributeValue
*/
public function setInputsAttribute($attributeName, $attributeValue)
{
foreach ($this->inputs as $input) {
$input->setAttribute($attributeName, $attributeValue);
}
}
}

0 comments on commit 147f7ed

Please sign in to comment.