RequestMatcher
class RequestMatcher (View source)
This class is a helper that can be used as a context for an Eel evaluation to match a request using the Eel Syntax. This is primarily used in the requestFilter of the Views.yaml configuration.
Properties
protected ActionRequest | $request | Request that will be used for the matcher. |
|
protected RequestMatcher | $parentMatcher | This property is set if parentRequest or mainRequest is used. The main purpose is to properly track the weight of the parentRequest and mainRequest Matchers through the addWeight method |
|
protected int | $weight | The weight is a value that's added up through various matching functions in here. This is needed to have a way to determine, how specific a configuration Method is because that's how the configuration will be sorted. |
Methods
No description
Check if the current Request's Package equals the argument
Check if the current Request's SubPackage equals the argument
Check if the current Request's Controller equals the argument
Check if the current Request's Action equals the argument
Check if the current Request's Format equals the argument
Compare a request propertyValue against an expected value and add the weight if it's true
Get a new RequestMatcher for the Request's ParentRequest
Get a new RequestMatcher for the Request's MainRequest
Return the current weight for this match
Add a weight to the total
Reset the match weight
Details
__construct(ActionRequest $actionRequest = null, RequestMatcher $parentMatcher = null)
No description
bool
isPackage(string $package)
Check if the current Request's Package equals the argument
bool
isSubPackage(string $subPackage)
Check if the current Request's SubPackage equals the argument
bool
isController(string $controller)
Check if the current Request's Controller equals the argument
bool
isAction(string $action)
Check if the current Request's Action equals the argument
bool
isFormat(string $format)
Check if the current Request's Format equals the argument
protected bool
matchRequestProperty(string $propertyName, string $expectedValue, int $weight)
Compare a request propertyValue against an expected value and add the weight if it's true
RequestMatcher
getParentRequest()
Get a new RequestMatcher for the Request's ParentRequest
RequestMatcher
getMainRequest()
Get a new RequestMatcher for the Request's MainRequest
int
getWeight()
Return the current weight for this match
void
addWeight(int $weight)
Add a weight to the total
void
resetWeight()
Reset the match weight