PHP Class Bolt\TemplateChooser

Show file Open project: bolt/bolt Class Usage Examples

Public Methods

Method Description
__construct ( Silex\Application $app ) Constructor.
homepage ( Content | Content[] $content ) : string Choose a template for the homepage.
listing ( array $contenttype ) : string Select a template for listing pages.
maintenance ( ) : string Select a template to use for the "maintenance" page.
record ( Content $record, array $data = null ) : string Choose a template for a single record page, e.g.: - '/page/about' - '/entry/lorum-ipsum'
search ( ) : string Select a search template.
taxonomy ( string $taxonomyslug ) : string Select a template for taxonomy.

Method Details

__construct() public method

Constructor.
public __construct ( Silex\Application $app )
$app Silex\Application

homepage() public method

Choose a template for the homepage.
public homepage ( Content | Content[] $content ) : string
$content Bolt\Legacy\Content | Bolt\Legacy\Content[]
return string

listing() public method

Select a template for listing pages.
public listing ( array $contenttype ) : string
$contenttype array
return string

maintenance() public method

Select a template to use for the "maintenance" page.
public maintenance ( ) : string
return string

record() public method

Refactor note: Using a FQCN for the hint here as a use statement causes a fatal in the unit tests… 'cause PHP and class_alias() versus namespaces.
public record ( Content $record, array $data = null ) : string
$record Bolt\Legacy\Content
$data array
return string

taxonomy() public method

Select a template for taxonomy.
public taxonomy ( string $taxonomyslug ) : string
$taxonomyslug string
return string