Skip to content

[DependencyInjection] lowercased parameter are inconsistent: config <=> ParametersBag #23381

@TomasVotruba

Description

@TomasVotruba
Q A
Bug report? yes
Feature request? yes
BC Break report? no
RFC? no
Symfony version any

I switched from Nette\DI to Symfony\DI. I use config statie.neon with this parameter setup:

parameters:
     basePath: "https://tomasvotruba.cz"

I put all parameters to template:

# pseudo-code

foreach ($this->container->getParameterBag()->all() as $key => $value) {
    $this->template->addValue($key, $value);
}

But when I try to render:

<!-- file.latte -->

{$basePath}

I get error, because only {$base**p**ath} is available. Parameter names are lowercased in ParameterBag::add() method.

I'd expect to keep the name same and not change it in any way.

What's the reason for this? How can I make it work?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions