Skip to content

Passing variable to dynamic filter #1034

Closed Answered by lrljoe
WojciechRhdt asked this question in Q&A
Discussion options

You must be logged in to vote

As this is an anonymous function, you'll need to pass the $criteria variable in, otherwise the function doesn't know that the variable exists.
e.g:

function (Builder $builder, float $value) use ($criteria) {

You will definitely have performance issues with your approach though, if you give some more detail around the use case, then I can probably point you in the right direction

Replies: 1 comment 4 replies

Comment options

lrljoe
Jan 31, 2023
Collaborator Sponsor

You must be logged in to vote
4 replies
@WojciechRhdt
Comment options

@lrljoe
Comment options

lrljoe Feb 1, 2023
Collaborator Sponsor

@WojciechRhdt
Comment options

@lrljoe
Comment options

lrljoe Feb 1, 2023
Collaborator Sponsor

Answer selected by WojciechRhdt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants