I am not sure if the term “Wildcard” can explain my point, but sometimes in some ready scripts we are able to call a non defined function like find_by_age(23) where age can be anything else that’s mapped to a database table record. So i can call find_by_name, find_by_email, find_by_id and so on. So how can we do such thing either in procedural or object oriented ways ?
I am not sure if the term Wildcard can explain my point, but sometimes
Share
The term you are looking for is magic method.
Basically like this:
For what you are looking for, you just filter out bad function calls and redirect good ones: