- if ( !empty( $this->mParams['disabled'] ) ) {
- $attribs['disabled'] = 'disabled';
- }
-
- if ( !empty( $this->mParams['readonly'] ) ) {
- $attribs['readonly'] = 'readonly';
- }
-
- if ( isset( $this->mParams['placeholder'] ) ) {
- $attribs['placeholder'] = $this->mParams['placeholder'];
- }
-
- foreach ( array( 'required', 'autofocus' ) as $param ) {
- if ( isset( $this->mParams[$param] ) ) {
- $attribs[$param] = '';
- }
- }
-
- return Html::element( 'textarea', $attribs, $value );
+ $allowedParams = array(
+ 'placeholder',
+ 'tabindex',
+ 'disabled',
+ 'readonly',
+ 'required',
+ 'autofocus'
+ );
+
+ $attribs += $this->getAttributes( $allowedParams );
+ return Html::textarea( $this->mName, $value, $attribs );