PHP Class Yosymfony\Spress\Core\ContentManager\Converter\MapConverter

This converter does not alter the content.
Author: Victor Pueras ([email protected])
Inheritance: implements Yosymfony\Spress\Core\ContentManager\Converter\ConverterInterface
Mostrar archivo Open project: spress/spress Class Usage Examples

Public Methods

Method Description
__construct ( array $fileExtensionMap = [] ) Constructor.
convert ( string $input ) : string Convert the input data.
getOutExtension ( string $extension ) : string The extension of filename result (without dot). E.g: 'html'.
getPriority ( ) : integer Get the converter priority.
matches ( string $extension ) : boolean If file's extension is support by converter.

Method Details

__construct() public method

Constructor.
public __construct ( array $fileExtensionMap = [] )
$fileExtensionMap array An extension map. e.g: ```php $converter = new MappingConverter([ 'twig' => 'html', 'twig.html' => 'html', ]); ```

convert() public method

Convert the input data.
public convert ( string $input ) : string
$input string The raw content without Front-matter
return string

getOutExtension() public method

The extension of filename result (without dot). E.g: 'html'.
public getOutExtension ( string $extension ) : string
$extension string File's extension
return string

getPriority() public method

Get the converter priority.
public getPriority ( ) : integer
return integer

matches() public method

If file's extension is support by converter.
public matches ( string $extension ) : boolean
$extension string Extension without dot
return boolean