Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Underscore.php is library of higher-order functions, such as, map, reduce, and filter. It provides functional style programming for, potentially, a myriad of potential uses in the context of Rules:
- foldr to #1612742: Get the last entry of a list
- max etc for #1600272: Calculating with lists: sum, mean, count, min, max
- size and toArray to #1525582: Action: generate a list from an integer
- contains in place of the 'Data comparison' in data.eval.rules
- and many more
More importantly than the actions and conditions provided from implementing this library are the components that will be shared, based on them.
========
Background info on Underscore.php:
- Underscore.php announcement and discussion on Hacker News
- Functional style programming with Underscore.php
- Rails inspired framework for MVC WordPress development which implement Underscore.php
- Other Underscore.php implementations: https://github.com/msurguy/blog & https://github.com/illuminate/foundation
Comments
Comment #1
mitchell CreditAttribution: mitchell commentedComment #2
dreftymac CreditAttribution: dreftymac as a volunteer commented+1
Comment #3
TR CreditAttribution: TR commentedThis is not going to happen unless someone contributes code. An ideal way to do that would be to create your own module which adds this feature to Rules. Then, if people find that module useful, we can discuss including its functionality in core Rules. Regardless, there are not going to be any major new features introduced into D7 Rules this late in the D7 development cycle. New features will go into D8.
Comment #4
TR CreditAttribution: TR commentedIt seems https://github.com/brianhaveri/Underscore.php hasn't had any commits for almost 8 years.
Also, there has been essentially no interest expressed by the community in seeing this feature added.
So I think it's appropriate to close this, since to add this sort of functionality we would have to start from square one again, identify the functionality needed, identify current code (if any) that can help us implement that functionality, then actually do the implementation for Rules.