private function templatePath($attribute, $file = null)
    {
        $value = $this->owner->{$attribute};

        $saveFilePath = $this->fileOption($attribute, 'saveFilePathInAttribute');
        $isFilledPath = $saveFilePath && !empty($value);

        $saveFileId = $this->fileOption($attribute, 'saveFileIdInAttribute');
        $isFilledId = $saveFileId && is_numeric($value) && $value;

        if (($isFilledPath || $isFilledId) && $file === null) {
            $file = $this->file($attribute);
        }

        if ($file !== null) {
            $handlerTemplatePath = $this->fileOption($attribute, 'templatePath');
            return $handlerTemplatePath($file);
        }
        return $value;
    }