Closed lowerends closed 9 years ago
You can use native PHP to achieve this purpose instead of adding a conditional return statement into each method of the package:
Active::pattern(array('foo', 'bar'), 'selected') ? : 'not-selected'
Indeed, but I thought it would be a nice addition to this package to make it more fluent.
I think you can make a PR so that I can write performance test for these two options :smile:
Cool, I'll give it a try the coming days.
I just created a pull request for this issue in #16. There's no extra conditional return statements used, so there will be no impact on performance.
Thanks!
A nice feature would be to have the possibility to add a third argument that would be returned in case the route does not match the given pattern. For example:
Would this be something you would consider to add? I'd be glad to help with a pull request!