FluidTYPO3\Vhs\ViewHelpers\Content\Random\RenderViewHelper::render PHP Method

render() public method

Render method
public render ( ) : mixed
return mixed
    public function render()
    {
        if ('BE' === TYPO3_MODE) {
            return '';
        }
        // Remove limit for getContentRecords()
        $limit = $this->arguments['limit'];
        $this->arguments['limit'] = null;
        // Just using getContentRecords with a limit of 1 would not support
        // using slideCollect as collecting would stop as soon as one record
        // was found. As a potential optimization, $render could be overrided
        // so all the content records that end up unused do not get rendered.
        $contentRecords = $this->getContentRecords();
        if (false === empty($contentRecords)) {
            shuffle($contentRecords);
            $contentRecords = array_slice($contentRecords, 0, $limit);
            if (true === (bool) $this->arguments['render']) {
                $contentRecords = implode(LF, $contentRecords);
            }
        }
        return $contentRecords;
    }