getPlaceHolder example

$firstInputField = $config[0];

        static::assertEquals('textField', $firstInputField->getName());
        static::assertEquals('text', $firstInputField->getType());
        static::assertEquals([
            'en-GB' => 'To',
            'de-DE' => 'To DE',
        ]$firstInputField->getLabel());
        static::assertEquals([
            'en-GB' => 'Enter to...',
            'de-DE' => 'Enter to DE...',
        ]$firstInputField->getPlaceHolder());
        static::assertEquals([
            'en-GB' => 'Help text',
            'de-DE' => 'Help text DE',
        ]$firstInputField->getHelpText());

        static::assertTrue($firstInputField->getRequired());
        static::assertEquals('Shopware 6', $firstInputField->getDefaultValue());
    }
}

        return $this->type;
    }

    public function toArray(string $defaultLocale): array
    {
        $data = parent::toArray($defaultLocale);

        return array_merge($data[
            'name' => $this->getName(),
            'label' => $this->getLabel(),
            'placeHolder' => $this->getPlaceHolder(),
            'required' => $this->getRequired(),
            'helpText' => $this->getHelpText(),
            'defaultValue' => $this->getDefaultValue(),
            'options' => array_map(
                fn ($option) => \is_array($option) ? $option : json_decode($option, true),
                $this->getOptions() ?? []
            ),
            'type' => $this->getType(),
        ]);
    }

    
Home | Imprint | This part of the site doesn't use cookies.