parameters:
    ezpublish_legacy.twig.extension.class: eZ\Publish\Core\MVC\Legacy\Templating\Twig\Extension\LegacyExtension
    ezpublish_legacy.twig.extension.template.js: 'EzPublishLegacyBundle::ez_legacy_render_js.html.twig'
    ezpublish_legacy.twig.extension.template.css: 'EzPublishLegacyBundle::ez_legacy_render_css.html.twig'
    ezpublish_legacy.templating.api_content_converter.class: eZ\Publish\Core\MVC\Legacy\Templating\Converter\ApiContentConverter
    ezpublish_legacy.templating.pageparts_converter.class: eZ\Publish\Core\MVC\Legacy\Templating\Converter\PagePartsConverter
    ezpublish_legacy.templating.delegating_converter.class: eZ\Publish\Core\MVC\Legacy\Templating\Converter\DelegatingConverter
    ezpublish_legacy.templating.generic_converter.class: eZ\Publish\Core\MVC\Legacy\Templating\Converter\GenericConverter
    ezpublish.templating.global_helper.legacy.class: eZ\Publish\Core\MVC\Legacy\Templating\GlobalHelper
    ezpublish_legacy.templating.legacy_helper.class: eZ\Publish\Core\MVC\Legacy\Templating\LegacyHelper

    # eZ Template as a real template engine
    templating.engine.eztpl.class: eZ\Publish\Core\MVC\Legacy\Templating\LegacyEngine
    assetic.eztpl_formula_loader.class: eZ\Publish\Core\MVC\Legacy\Templating\LegacyFormulaLoader
    twig.class: eZ\Publish\Core\MVC\Legacy\Templating\Twig\Environment

services:
    ezpublish_legacy.twig.extension:
        class: %ezpublish_legacy.twig.extension.class%
        arguments:
            - @templating.engine.eztpl
            - @ezpublish_legacy.templating.legacy_helper
            - %ezpublish_legacy.twig.extension.template.js%
            - %ezpublish_legacy.twig.extension.template.css%
        tags:
            - {name: twig.extension}

    ezpublish_legacy.templating.generic_converter:
        class: %ezpublish_legacy.templating.generic_converter.class%

    ezpublish_legacy.templating.delegating_converter:
        class: %ezpublish_legacy.templating.delegating_converter.class%
        arguments: [@ezpublish_legacy.templating.generic_converter]

    ezpublish_legacy.templating.object_converter:
        alias: ezpublish_legacy.templating.delegating_converter

    ezpublish_legacy.templating.api_content_converter:
        class: %ezpublish_legacy.templating.api_content_converter.class%
        arguments: [@ezpublish_legacy.kernel]
        tags:
            - {name: ezpublish_legacy.templating.converter, for: %ezpublish.api.content.class%}
            - {name: ezpublish_legacy.templating.converter, for: %ezpublish.api.location.class%}

    ezpublish_legacy.templating.pageparts_converter:
        class: %ezpublish_legacy.templating.pageparts_converter.class%
        tags:
            - {name: ezpublish_legacy.templating.converter, for: %ezpublish.fieldType.ezpage.block.class%}
            - {name: ezpublish_legacy.templating.converter, for: %ezpublish.fieldType.ezpage.zone.class%}

    ezpublish_legacy.templating.legacy_helper:
        class: %ezpublish_legacy.templating.legacy_helper.class%
        arguments: [@ezpublish_legacy.kernel]

    ezpublish.templating.global_helper.legacy:
        class: %ezpublish.templating.global_helper.legacy.class%
        parent: ezpublish.templating.global_helper.core
        calls:
            - [setLegacyHelper, [@ezpublish_legacy.templating.legacy_helper]]

    # Overriding core helper
    ezpublish.templating.global_helper:
        alias: ezpublish.templating.global_helper.legacy

    templating.engine.eztpl:
        class: %templating.engine.eztpl.class%
        arguments: [@ezpublish_legacy.kernel, @ezpublish_legacy.templating.object_converter]

    assetic.eztpl_formula_loader:
        class: %assetic.eztpl_formula_loader.class%
        tags:
            - {name: assetic.formula_loader, alias: eztpl}
