FluidTYPO3\Flux\View\PreviewView::getPreview PHP Method

getPreview() public method

public getPreview ( FluidTYPO3\Flux\Provider\ProviderInterface $provider, array $row ) : string
$provider FluidTYPO3\Flux\Provider\ProviderInterface
$row array
return string
    public function getPreview(ProviderInterface $provider, array $row)
    {
        $form = $provider->getForm($row);
        $options = $this->getPreviewOptions($form);
        $mode = $this->getOptionMode($options);
        $previewContent = (string) $this->renderPreviewSection($provider, $row, $form);
        if (self::MODE_NONE === $mode || FALSE === is_object($form)) {
            return $previewContent;
        }
        $gridContent = $this->renderGrid($provider, $row, $form);
        if (self::MODE_APPEND === $mode) {
            $previewContent = $previewContent . $gridContent;
        } else {
            if (self::MODE_PREPEND === $mode) {
                $previewContent = $gridContent . $previewContent;
            }
        }
        $previewContent = trim($previewContent);
        return $previewContent;
    }