craue / CraueConfigBundle

Database-stored settings made available via a service for your Symfony project.
MIT License
173 stars 35 forks source link

preSave / preUpdate events #31

Closed ikvasnica closed 8 years ago

ikvasnica commented 8 years ago

It would be great if the bundle allows us to subscribe to some events - especially right before saving or updating a setting.

I need to validate some of the settings (f.e. to be only numeric). Sure, I can write my own controller and form, but this would be an easier way.

craue commented 8 years ago

But you wouldn't be able to properly render form errors by using such an event, right?

ikvasnica commented 8 years ago

@craue That's true. Anyway, the need for differentiating string / numeric / other types of settings and validating them is still here, because now only strings are supported.

Also, an option to hook into the mentioned events might be useful, even though not for this particular issue.

craue commented 8 years ago

The bundle probably won't support different data types (see #5, #29), so you'll have to save the values as strings and handle them as needed.

Could you be more precise about the additional features you'd like to use?