public function homepage(Request $request)
    {
        $homepage = $this->getOption('theme/homepage') ?: $this->getOption('general/homepage');
        $listingParameters = $this->getListingParameters($homepage, true);
        $content = $this->getContent($homepage, $listingParameters);

        $template = $this->templateChooser()->homepage($content);
        $globals = [];

        if (is_array($content) && count($content) > 0) {
            $first = current($content);
            $globals[$first->contenttype['slug']] = $content;
            $globals['records'] = $content;
        } elseif (is_object($content)) {
            $globals['record'] = $content;
            $globals[$content->contenttype['singular_slug']] = $content;
            $globals['records'] = [$content->id => $content];
        }

        return $this->render($template, [], $globals);
    }
public function homepage(Request $request)
    {
        $homepage = $this->getOption('theme/homepage') ?: $this->getOption('general/homepage');
        $listingParameters = $this->getListingParameters($homepage, true);
        $content = $this->getContent($homepage, $listingParameters);

        $template = $this->templateChooser()->homepage($content);
        $globals = [];

        if (is_array($content) && count($content) > 0) {
            $first = current($content);
            $globals[$first->contenttype['slug']] = $content;
            $globals['records'] = $content;
        } elseif (is_object($content)) {
            $globals['record'] = $content;
            $globals[$content->contenttype['singular_slug']] = $content;
            $globals['records'] = [$content->id => $content];
        }

        return $this->render($template, [], $globals);
    }
public function homepage ( Request $ request ) { $ homepage = $ this -> getOption ( 'theme/homepage' ) ? : $ this -> getOption ( 'general/homepage' ) ; $ listingParameters = $ this -> getListingParameters ( $ homepage , true ) ; $ content = $ this -> getContent ( $ homepage , $ listingParameters ) ; $ template = $ this -> templateChooser ( ) -> homepage ( $ content ) ; $ globals = [ ] ; if ( is_array ( $ content ) && count ( $ content ) > 0 ) { $ first = current ( $ content ) ; $ globals [ $ first -> contenttype [ 'slug' ] ] = $ content ; $ globals [ 'records' ] = $ content ; } elseif ( is_object ( $ content ) ) { $ globals [ 'record' ] = $ content ; $ globals [ $ content -> contenttype [ 'singular_slug' ] ] = $ content ; $ globals [ 'records' ] = [ $ content -> id => $ content ] ; } return $ this -> render ( $ template , [ ] , $ globals ) ; }
Controller for the "Homepage" route. Usually the front page of the website.

@param Request $request

@return TemplateResponse
Controller for the Homepage route . Usually the front page of the website .