Page MenuHomeWickedGov Phorge

MultilineTextInputWidget.php
No OneTemporary

Size
1023 B
Referenced Files
None
Subscribers
None

MultilineTextInputWidget.php

<?php
namespace OOUI;
/**
* Input widget with a text field.
*/
class MultilineTextInputWidget extends TextInputWidget {
/**
* Allow multiple lines of text.
*
* @var bool
*/
protected $multiline = true;
/**
* @param array $config Configuration options
* - int $config['rows'] Number of visible lines in textarea.
*/
public function __construct( array $config = [] ) {
// Config initialization
$config = array_merge( [
'readOnly' => false,
'autofocus' => false,
'required' => false,
], $config );
// Parent constructor
parent::__construct( $config );
if ( $config['rows'] ?? null ) {
$this->input->setAttributes( [ 'rows' => $config['rows'] ] );
}
}
/** @inheritDoc */
protected function getInputElement( $config ) {
return new Tag( 'textarea' );
}
/** @inheritDoc */
public function getConfig( &$config ) {
$rows = $this->input->getAttribute( 'rows' );
if ( $rows !== null ) {
$config['rows'] = $rows;
}
return parent::getConfig( $config );
}
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Aug 19, 09:16 (2 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
02/b8/09d1c8ef9f7d0f345e0ef9e9c935
Default Alt Text
MultilineTextInputWidget.php (1023 B)

Event Timeline