for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Yiisoft\Form\Field\Base;
/**
* @psalm-require-extends AbstractField
*/
trait ReadonlyTrait
{
* A boolean attribute that controls whether or not the user can edit the form control.
*
* @param bool $value Whether to allow the value to be edited by the user.
* @link https://html.spec.whatwg.org/multipage/input.html#attr-input-readonly
public function readonly(bool $value = true): static
$new = clone $this;
$new->inputTagAttributes['readonly'] = $value;
inputTagAttributes
return $new;
}