public function render()
    {
        /** @var TbForm $parent */
        $parent = $this->getParent();
        /** @var TbActiveForm $form */
        $form = $parent->getActiveFormWidget();
        /** @var CModel $model */
        $model = $parent->getModel();

        // Hidden fields do not require control groups.
        if ($this->type === TbHtml::INPUT_TYPE_HIDDEN) {
            return $form->hiddenField($model, $this->name, $this->attributes);
        }

        if (isset(self::$coreTypes[$this->type])) {
            $type = self::$coreTypes[$this->type];
        } else {
            $type = TbHtml::INPUT_TYPE_CUSTOM;
            $properties = $this->attributes;
            $properties['model'] = $model;
            $properties['attribute'] = $this->name;
            $this->attributes['input'] = $parent->getOwner()->widget($this->type, $properties, true);
        }

        return $form->createControlGroup($type, $model, $this->name, $this->attributes, $this->items);
    }