From: Gergő Tisza Date: Fri, 1 Apr 2016 12:08:18 +0000 (+0300) Subject: Allow setting HTMLForm name X-Git-Tag: 1.31.0-rc.0~7423^2~1 X-Git-Url: https://git.cyclocoop.org/admin/%7B%7Blocalurl:Special:UserLogin%7D%7D?a=commitdiff_plain;h=eed7a00166ff82c9923bc67abf5efdb879e76f78;p=lhc%2Fweb%2Fwiklou.git Allow setting HTMLForm name Change-Id: I85f5492e0b99a5661dbed9814a0e3f3b9bc63d32 --- diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index bf46e558ff..c3aa0448db 100644 --- a/includes/htmlform/HTMLForm.php +++ b/includes/htmlform/HTMLForm.php @@ -180,6 +180,7 @@ class HTMLForm extends ContextSource { protected $mSectionFooters = []; protected $mPost = ''; protected $mId; + protected $mName; protected $mTableId = ''; protected $mSubmitID; @@ -1006,6 +1007,9 @@ class HTMLForm extends ContextSource { if ( !empty( $this->mAutocomplete ) ) { $attribs['autocomplete'] = $this->mAutocomplete; } + if ( !empty ( $this->mName ) ) { + $attribs['name'] = $this->mName; + } return $attribs; } @@ -1347,6 +1351,16 @@ class HTMLForm extends ContextSource { return $this; } + /** + * @param string$ name 'name' attribute for the form + * @return HTMLForm $this for chaining calls + */ + public function setName( $name ) { + $this->mName = $name; + + return $this; + } + /** * Prompt the whole form to be wrapped in a "
", with * this text as its "" element.