php/widgets/TextInputWidget.php
public function setReadOnly( $state ) {
		$this->readOnly = (bool)$state;
		if ( $this->readOnly ) {
			$this->input->setAttributes( [ 'readonly' => 'readonly' ] );
		} else {
			$this->input->removeAttributes( [ 'readonly' ] );
		}
		return $this;
	}
public function setReadOnly( $state ) {
		$this->readOnly = (bool)$state;
		if ( $this->readOnly ) {
			$this->input->setAttributes( [ 'readonly' => 'readonly' ] );
		} else {
			$this->input->removeAttributes( [ 'readonly' ] );
		}
		return $this;
	}
public function setReadOnly ( $ state ) { $ this -> readOnly = ( bool ) $ state ; if ( $ this -> readOnly ) { $ this -> input -> setAttributes ( [ 'readonly' => 'readonly' ] ) ; } else { $ this -> input -> removeAttributes ( [ 'readonly' ] ) ; } return $ this ; }
Set the read-only state of the widget. This should probably change the widget's appearance and
prevent it from being used.

@param bool $state Make input read-only
@return $this
Set the read - only state of the widget . This should probably change the widget s appearance and prevent it from being used .