Skip to content

Conversation

@intoeetive
Copy link
Contributor

@intoeetive intoeetive commented Dec 7, 2022

Allow variables to use multiple modifiers; closes #136
Enabled additional variable modifiers to be registered by add-ons; closes #1203

Docs: ExpressionEngine/ExpressionEngine-User-Guide#546

  • allow specifying parameters for modifier by prefixing parameter name with modifier name. E.g. limit:characters="1" would work the same as characters="1" when using limit modifier (but also have higher priority)
  • allow modifiers to be chained, e.g. var_name:limit:spellout.
  • allow add-ons to provide their modifiers. They would need to be registered in addon.setup.php file and then be called with __call in ModifiableTrait. The method_exists checks would then need to be updated to also check whether modifier is registered by add-on

@intoeetive intoeetive marked this pull request as ready for review December 22, 2022 09:12
@intoeetive intoeetive added this to the 7.3.0 milestone Dec 22, 2022
@intoeetive intoeetive changed the base branch from 7.dev to release/7.3.0 January 4, 2023 15:06
@bryannielsen bryannielsen self-requested a review January 13, 2023 14:21
@intoeetive intoeetive changed the base branch from release/7.3.0 to 7.dev January 23, 2023 12:51
@intoeetive intoeetive changed the base branch from 7.dev to release/7.3.0 January 23, 2023 12:51
@intoeetive
Copy link
Contributor Author

@bryannielsen I made the necessary updates so that File field modifiers could be chained.

As of moving the __call method contents into separate function, I figured out that is not necessary - implementing __call in fieldtype level does not make any effect, because all methods require certain syntax to get parsed / processed - there's no chance someone would implement those

@bryannielsen bryannielsen merged commit 3ef0bb0 into release/7.3.0 Jan 26, 2023
@bryannielsen bryannielsen deleted the feature/7.x/modifier-updates branch January 26, 2023 13:21
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.

Provide for additional variable modifier traits to be registered by add-ons Allow variables to use multiple modifiers

3 participants