Skip to content

Conversation

@iamgergo
Copy link
Contributor

@iamgergo iamgergo commented Sep 8, 2023

Currently it is not possible to automatically convert to array or JSON serialize the ComponentAttributeBag, but in some cases it would be handy.

json_encode(['attributes' => new ComponentAttributeBag(['class' => 'form-control'])]);

// {"attributes":{}}

We can use (new ComponentAttributeBag(['class' => 'form-control']))->getAttributes(), but it would be a better DX to handle this automatically, in my opinion.

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.

2 participants