public function registerFormWidget($className, $widgetInfo = null)
    {
        if (!is_array($widgetInfo)) {
            $widgetInfo = ['code' => $widgetInfo];
        }

        $widgetCode = $widgetInfo['code'] ?? null;

        if (!$widgetCode) {
            $widgetCode = Str::getClassId($className);
        }

        $this->formWidgets[$className] = $widgetInfo;
        $this->formWidgetHints[$widgetCode] = $className;
    }
public function registerFormWidget($className, $widgetInfo = null)
    {
        if (!is_array($widgetInfo)) {
            $widgetInfo = ['code' => $widgetInfo];
        }

        $widgetCode = $widgetInfo['code'] ?? null;

        if (!$widgetCode) {
            $widgetCode = Str::getClassId($className);
        }

        $this->formWidgets[$className] = $widgetInfo;
        $this->formWidgetHints[$widgetCode] = $className;
    }
public function registerFormWidget ( $ className , $ widgetInfo = null ) { if ( ! is_array ( $ widgetInfo ) ) { $ widgetInfo = [ 'code' => $ widgetInfo ] ; } $ widgetCode = $ widgetInfo [ 'code' ] ?? null ; if ( ! $ widgetCode ) { $ widgetCode = Str :: getClassId ( $ className ) ; } $ this -> formWidgets [ $ className ] = $ widgetInfo ; $ this -> formWidgetHints [ $ widgetCode ] = $ className ; }
Registers a single form widget.
@param string $className Widget class name.
@param array $widgetInfo Registration information, can contain a `code` key.
@return void
Registers a single form widget .