Skip to content

Optional support for AssetExtension for ImageTwigExtension #18

@alexander-schranz

Description

@alexander-schranz

Currently the ImageExtension does not have support for asset function this should be introduce by optional injecting the AssetExtension of Symfony Twig Bridge.

E.g.:

services:
      Sulu\Twig\Extensions\ImageTwigExtension:
          arguments:
               - 'placeholders'
               - '@?twig.extension.assets'
public function __construct(
    ?string $placeholderPath = null, 
    ?AssetExtension $assetExtension, 
    ?string $defaultPackageName
) {
     // ...
}

public function getImage($media, $attributes = [], array $sources = [], ?string $packageName = null): string {
     // ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions