Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TwigHooks] Replace ParameterBag with the DataBag #9

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

jakubtobiasz
Copy link
Contributor

Currently, we've been using the ParameterBag from the Symfony's DI, but it's limit the types we can pass to it. So, I've created a custom DataBag providing a pretty neat DX.

Examples:

$dataBag = new DataBag(['some' => 'values]); # creating a data bag from array
$dataBag->has('key'); # checking whether it has a given key
$dataBag->key; # accessing a given key, so in the expression language we can write it as dataBag.key

@jakubtobiasz jakubtobiasz added twig hooks Issues and Pull Requests related to Twig Hooks feature labels Apr 23, 2024
@jakubtobiasz jakubtobiasz merged commit 169059a into main Apr 23, 2024
13 checks passed
@jakubtobiasz jakubtobiasz deleted the feature/data-bag branch April 23, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature twig hooks Issues and Pull Requests related to Twig Hooks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant