for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Itstructure\FieldWidgets;
use yii\helpers\ArrayHelper;
/**
* Class FieldTypeDropdown
* Class for printing the form dropdown field.
*
* @package Itstructure\FieldWidgets
*/
class FieldTypeDropdown extends FieldType
{
* @return string
public function run(): string
return $this->getField()
->dropDownList(
$this->getData(),
ArrayHelper::merge(
[
'prompt' => 'Not chosen'
],
$this->getOptions()
)
->label($this->getLabel());
}