allow for customising prefix of @attr names #265
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a feature we're intending to add just for the 1.x branch of Catalyst, in order to ease the transition into Catalyst 2.0.
This change will respect a
attrPrefix
static member on a class, and use that to derive the prefix of all@attr
s in the class. This will default todata-
meaning this is a non-breaking change, but for classes that wish to - they can add, for example,static attrPrefix = ''
to remove thedata-
prefix. This allows us to transition controllers one-by-one while using Catalyst 1.x, which will make the transition to Catalyst 2.x much more straightforward.This property will not be in Catalyst 2.0, as there is no need for it, as attrs are not prefixed with anything in Catalyst 2.0.