protected function renderDataRecursive($data)
    {
        if (!is_array($data) && !($data instanceof Traversable)) {
            throw new InvalidArgumentException('The renderable data must be iterable.');
        }

        if (!$this->form() instanceof ObjectContainerInterface) {
            throw new RuntimeException(sprintf(
                'The [%s] widget has no data model.',
                static::CLASS
            ));
        }

        foreach ($data as $key => $val) {
            if (is_string($val)) {
                $data[$key] = $this->renderData($val);
            } elseif (is_array($val) || ($val instanceof Traversable)) {
                $data[$key] = $this->renderDataRecursive($val);
            } else {
                continue;
            }
        }

        return $data;
    }