0 follower

Interface Yiisoft\Assets\AssetConverterInterface

Implemented byYiisoft\Assets\AssetConverter

The AssetConverterInterface must be implemented by asset converter classes. The job of such class is to convert an asset from one format to another. For example, from Sass to CSS.

Psalm Types

Name Value
ConverterOptions array<string, array{command?: string, path?: string}|null>

Public Methods

Hide inherited methods

Method Description Defined By
convert() Converts a given asset file into another format. Yiisoft\Assets\AssetConverterInterface

Method Details

Hide inherited methods

convert() public abstract method

Converts a given asset file into another format.

public abstract string convert ( string $asset, string $basePath, array $optionsConverter = [] )
$asset string

The asset file path, relative to {@see \Yiisoft\Assets\AssetBundle::$basePath}.

$basePath string

The directory the $asset is relative to.

$optionsConverter array

It allows you to {@see \Yiisoft\Assets\AssetConverter::runCommand()} options by {@see \Yiisoft\Assets\AssetBundle}.

return string

The converted asset file path, relative to {@see \Yiisoft\Assets\AssetBundle::$basePath}.

                public function convert(string $asset, string $basePath, array $optionsConverter = []): string;