PHP Class Sculpin\Core\Formatter\FormatterManager

Author: Beau Simensen ([email protected])
Exibir arquivo Open project: sculpin/sculpin Class Usage Examples

Protected Properties

Property Type Description
$dataProviderManager Sculpin\Core\DataProvider\DataProviderManager Data Provider Manager
$defaultFormatter string Default formatter
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface Event Dispatcher
$formatters array Formatters
$siteConfiguration Dflydev\DotAccessConfiguration\Configuration Site Configuration

Public Methods

Method Description
__construct ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, Dflydev\DotAccessConfiguration\Configuration $siteConfiguration, Sculpin\Core\DataProvider\DataProviderManager $dataProviderManager = null ) Constructor.
buildFormatContext ( string $templateId, string $template, array $context ) : Sculpin\Core\Formatter\FormatContext Build a Format Context
defaultFormatter ( ) : string Default Formatter.
formatBlocks ( string $templateId, string $template, array $context ) : array Format blocks
formatPage ( string $templateId, string $template, array $context ) : string Format a page
formatSourceBlocks ( Sculpin\Core\Source\SourceInterface $source ) : array Format blocks for a Source
formatSourcePage ( Sculpin\Core\Source\SourceInterface $source ) : string Format a page for a Source
formatter ( string $name ) : Sculpin\Core\Formatter\FormatterInterface Formatter
registerFormatter ( string $name, Sculpin\Core\Formatter\FormatterInterface $formatter ) Register formatter
setDataProviderManager ( Sculpin\Core\DataProvider\DataProviderManager $dataProviderManager = null ) Set Data Provider Manager.

Protected Methods

Method Description
buildBaseFormatContext ( mixed $context ) : Dflydev\DotAccessConfiguration\Configuration Build base format context

Method Details

__construct() public method

Constructor.
public __construct ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, Dflydev\DotAccessConfiguration\Configuration $siteConfiguration, Sculpin\Core\DataProvider\DataProviderManager $dataProviderManager = null )
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface Event Dispatcher
$siteConfiguration Dflydev\DotAccessConfiguration\Configuration Site Configuration
$dataProviderManager Sculpin\Core\DataProvider\DataProviderManager Data Provider Manager

buildBaseFormatContext() protected method

Build base format context
protected buildBaseFormatContext ( mixed $context ) : Dflydev\DotAccessConfiguration\Configuration
$context mixed
return Dflydev\DotAccessConfiguration\Configuration

buildFormatContext() public method

Build a Format Context
public buildFormatContext ( string $templateId, string $template, array $context ) : Sculpin\Core\Formatter\FormatContext
$templateId string Template ID
$template string Template
$context array Context
return Sculpin\Core\Formatter\FormatContext

defaultFormatter() public method

Default Formatter.
public defaultFormatter ( ) : string
return string

formatBlocks() public method

Format blocks
public formatBlocks ( string $templateId, string $template, array $context ) : array
$templateId string Template ID
$template string Template
$context array Context
return array

formatPage() public method

Format a page
public formatPage ( string $templateId, string $template, array $context ) : string
$templateId string Template ID
$template string Template
$context array Context
return string

formatSourceBlocks() public method

Format blocks for a Source
public formatSourceBlocks ( Sculpin\Core\Source\SourceInterface $source ) : array
$source Sculpin\Core\Source\SourceInterface Source
return array

formatSourcePage() public method

Format a page for a Source
public formatSourcePage ( Sculpin\Core\Source\SourceInterface $source ) : string
$source Sculpin\Core\Source\SourceInterface Source
return string

formatter() public method

Formatter
public formatter ( string $name ) : Sculpin\Core\Formatter\FormatterInterface
$name string Name
return Sculpin\Core\Formatter\FormatterInterface

registerFormatter() public method

Register formatter
public registerFormatter ( string $name, Sculpin\Core\Formatter\FormatterInterface $formatter )
$name string Name
$formatter Sculpin\Core\Formatter\FormatterInterface Formatter

setDataProviderManager() public method

NOTE: This is a hack because Symfony DiC cannot handle passing Data Provider Manager via constructor injection as some data providers might also rely on formatter. Hurray for circular dependencies. :(
public setDataProviderManager ( Sculpin\Core\DataProvider\DataProviderManager $dataProviderManager = null )
$dataProviderManager Sculpin\Core\DataProvider\DataProviderManager Data Provider Manager

Property Details

$dataProviderManager protected_oe property

Data Provider Manager
protected DataProviderManager,Sculpin\Core\DataProvider $dataProviderManager
return Sculpin\Core\DataProvider\DataProviderManager

$defaultFormatter protected_oe property

Default formatter
protected string $defaultFormatter
return string

$eventDispatcher protected_oe property

Event Dispatcher
protected EventDispatcherInterface,Symfony\Component\EventDispatcher $eventDispatcher
return Symfony\Component\EventDispatcher\EventDispatcherInterface

$formatters protected_oe property

Formatters
protected array $formatters
return array

$siteConfiguration protected_oe property

Site Configuration
protected Configuration,Dflydev\DotAccessConfiguration $siteConfiguration
return Dflydev\DotAccessConfiguration\Configuration