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

[WIP] Added context to ChoicesProvider for enabling dynamic choices #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

christianbader
Copy link

No description provided.

@christianbader christianbader changed the title [WIP] Added context to ChoiceOptionProvider for dynamic choices [WIP] Added context to ChoicesProvider for enabling dynamic choices Mar 21, 2024
@limenet limenet self-requested a review March 21, 2024 11:12
@@ -58,13 +58,13 @@ public function __construct(
$this->liform = $liform;
}

public function build(string $name): FormBuilderInterface
public function build(string $name, mixed $context = null): FormBuilderInterface
Copy link
Author

@christianbader christianbader Mar 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extend the following functions with context:

 /**
 * @return array<mixed>
 */
public function buildJson(string $name): array
{
    return $this->json($this->buildForm($name));
}

public function buildJsonString(string $name): string
{
    return json_encode($this->buildJson($name), \JSON_THROW_ON_ERROR);
}

public function buildForm(string $name): FormInterface
{
    return $this->build($name)->getForm();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant