matchesSkin.php
Table of Contents
Functions
- matchesSkin() : bool
- Tests whether a `Field::SKINS` marker matches the active request skin.
Functions
matchesSkin()
Tests whether a `Field::SKINS` marker matches the active request skin.
matchesSkin(mixed $skins, string|null $currentSkin) : bool
Used internally by the AQL projection layer (FieldsTrait::filterFieldsBySkin)
to decide whether a field declared with Field::SKINS => [...] should be
projected for the current ?skin= query parameter.
Accepted shapes for $skins :
null— no skin restriction declared, always matchesarray<string>— list of skins that activate the field, e.g.[ Skin::DEFAULT , Skin::FULL ]string— comma-separated list, e.g."main,full"
String comparisons are strict and trimmed of surrounding whitespace.
Parameters
- $skins : mixed
-
The
Field::SKINSvalue from the field definition. - $currentSkin : string|null
-
The active request skin, or
nullwhen no skin is set.
Tags
Return values
bool —true if the field must be kept in the projection, false to drop it.