Bolt\TemplateChooser::listing PHP Метод

listing() публичный Метод

Select a template for listing pages.
public listing ( array $contenttype ) : string
$contenttype array
Результат string
    public function listing($contenttype)
    {
        // First candidate: Global config.yml
        $template = $this->app['config']->get('general/listing_template');
        // Second candidate: Theme-specific config.yml file.
        if ($this->app['config']->get('theme/listing_template')) {
            $template = $this->app['config']->get('theme/listing_template');
        }
        // Third candidate: a template with the same filename as the name of
        // the contenttype.
        if ($this->app['render']->hasTemplate($contenttype['slug'] . '.twig')) {
            $template = $contenttype['slug'] . '.twig';
        }
        // Fourth candidate: defined specificaly in the contenttype.
        if (!empty($contenttype['listing_template'])) {
            $template = $contenttype['listing_template'];
        }
        return $template;
    }