0 follower

Class Yiisoft\Form\PureField\FieldFactory

InheritanceYiisoft\Form\PureField\FieldFactory

Protected Properties

Hide inherited properties

Property Type Description Defined By
$defaultTheme string|null Yiisoft\Form\PureField\FieldFactory

Property Details

Hide inherited properties

$defaultTheme protected property
protected string|null $defaultTheme null

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( string|null $defaultTheme null )
$defaultTheme string|null

                final public function __construct(
    protected readonly ?string $defaultTheme = null,
) {
}

            
button() public method

public Yiisoft\Form\Field\Button button ( string|null $content null, array $config = [], string|null $theme null )
$content string|null
$config array
$theme string|null

                final public function button(?string $content = null, array $config = [], ?string $theme = null): Button
{
    $field = Button::widget(config: $config, theme: $theme ?? $this->defaultTheme);
    if ($content !== null) {
        $field = $field->content($content);
    }
    return $field;
}

            
buttonGroup() public method

public Yiisoft\Form\Field\ButtonGroup buttonGroup ( array $config = [], string|null $theme null )
$config array
$theme string|null

                final public function buttonGroup(array $config = [], ?string $theme = null): ButtonGroup
{
    return ButtonGroup::widget(config: $config, theme: $theme ?? $this->defaultTheme);
}

            
checkbox() public method

public Yiisoft\Form\Field\Checkbox checkbox ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function checkbox(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Checkbox {
    return Checkbox::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
checkboxList() public method

public Yiisoft\Form\Field\CheckboxList checkboxList ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function checkboxList(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): CheckboxList {
    return CheckboxList::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
color() public method

public Yiisoft\Form\Field\Color color ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function color(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Color {
    return Color::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
date() public method

public Yiisoft\Form\Field\Date date ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function date(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Date {
    return Date::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
dateTimeLocal() public method

public Yiisoft\Form\Field\DateTimeLocal dateTimeLocal ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function dateTimeLocal(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): DateTimeLocal {
    return DateTimeLocal::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
email() public method

public Yiisoft\Form\Field\Email email ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function email(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Email {
    return Email::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
error() public method

public Yiisoft\Form\Field\Part\Error error ( string|null $message null, array $config = [], string|null $theme null )
$message string|null
$config array
$theme string|null

                final public function error(?string $message = null, array $config = [], ?string $theme = null): Error
{
    return Error::widget(config: $config, theme: $theme ?? $this->defaultTheme)->message($message);
}

            
errorSummary() public method

public Yiisoft\Form\Field\ErrorSummary errorSummary ( array $errors = [], array $config = [], string|null $theme null )
$errors array
$config array
$theme string|null

                final public function errorSummary(
    array $errors = [],
    array $config = [],
    ?string $theme = null,
): ErrorSummary {
    return ErrorSummary::widget(config: $config, theme: $theme ?? $this->defaultTheme)->errors($errors);
}

            
fieldset() public method

public Yiisoft\Form\Field\Fieldset fieldset ( array $config = [], string|null $theme null )
$config array
$theme string|null

                final public function fieldset(array $config = [], ?string $theme = null): Fieldset
{
    return Fieldset::widget(config: $config, theme: $theme ?? $this->defaultTheme);
}

            
file() public method

public Yiisoft\Form\Field\File file ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function file(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): File {
    return File::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
hidden() public method

public Yiisoft\Form\Field\Hidden hidden ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function hidden(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Hidden {
    return Hidden::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
hint() public method

public Yiisoft\Form\Field\Part\Hint hint ( string|null $content null, array $config = [], string|null $theme null )
$content string|null
$config array
$theme string|null

                final public function hint(?string $content = null, array $config = [], ?string $theme = null): Hint
{
    return Hint::widget(config: $config, theme: $theme ?? $this->defaultTheme)->content($content);
}

            
image() public method

public Yiisoft\Form\Field\Image image ( string|null $url null, array $config = [], string|null $theme null )
$url string|null
$config array
$theme string|null

                final public function image(?string $url = null, array $config = [], ?string $theme = null): Image
{
    $field = Image::widget(config: $config, theme: $theme ?? $this->defaultTheme);
    if ($url !== null) {
        $field = $field->src($url);
    }
    return $field;
}

            
label() public method

public Yiisoft\Form\Field\Part\Label label ( string|null $content null, array $config = [], string|null $theme null )
$content string|null
$config array
$theme string|null

                final public function label(?string $content = null, array $config = [], ?string $theme = null): Label
{
    return Label::widget(config: $config, theme: $theme ?? $this->defaultTheme)->content($content);
}

            
number() public method

public Yiisoft\Form\Field\Number number ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function number(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Number {
    return Number::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
password() public method

public Yiisoft\Form\Field\Password password ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function password(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Password {
    return Password::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
radioList() public method

public Yiisoft\Form\Field\RadioList radioList ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function radioList(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): RadioList {
    return RadioList::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
range() public method

public Yiisoft\Form\Field\Range range ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function range(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Range {
    return Range::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
resetButton() public method

public Yiisoft\Form\Field\ResetButton resetButton ( string|null $content null, array $config = [], string|null $theme null )
$content string|null
$config array
$theme string|null

                final public function resetButton(
    ?string $content = null,
    array $config = [],
    ?string $theme = null,
): ResetButton {
    $field = ResetButton::widget(config: $config, theme: $theme ?? $this->defaultTheme);
    if ($content !== null) {
        $field = $field->content($content);
    }
    return $field;
}

            
select() public method

public Yiisoft\Form\Field\Select select ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function select(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Select {
    return Select::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
submitButton() public method

public Yiisoft\Form\Field\SubmitButton submitButton ( string|null $content null, array $config = [], string|null $theme null )
$content string|null
$config array
$theme string|null

                final public function submitButton(
    ?string $content = null,
    array $config = [],
    ?string $theme = null,
): SubmitButton {
    $field = SubmitButton::widget(config: $config, theme: $theme ?? $this->defaultTheme);
    if ($content !== null) {
        $field = $field->content($content);
    }
    return $field;
}

            
telephone() public method

public Yiisoft\Form\Field\Telephone telephone ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function telephone(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Telephone {
    return Telephone::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
text() public method

public Yiisoft\Form\Field\Text text ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function text(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Text {
    return Text::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
textarea() public method

public Yiisoft\Form\Field\Textarea textarea ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function textarea(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Textarea {
    return Textarea::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
time() public method

public Yiisoft\Form\Field\Time time ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function time(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Time {
    return Time::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}

            
url() public method

public Yiisoft\Form\Field\Url url ( string|null $name null, mixed $value null, array $config = [], string|null $theme null )
$name string|null
$value mixed
$config array
$theme string|null

                final public function url(
    ?string $name = null,
    mixed $value = null,
    array $config = [],
    ?string $theme = null,
): Url {
    return Url::widget(config: $config, theme: $theme ?? $this->defaultTheme)
        ->inputData(new InputData($name, $value));
}