jeyroik / extas-conditions
Extas conditions package
Installs: 1 673
Dependents: 11
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
Requires (Dev)
README
Описание
Условия и их проверка.
Использование
- Установить обработчики.
# vendor/bin/extas i
- Для использования проще всего реализовать интерфейс
extas\interfaces\conditions\IHasConditions
.
$hasCondition = new class ([ IHasValue::FIELD__VALUE => [ [ 'value' => 5, 'condition' => '>' ], [ 'value' => 10, 'condition' => '<' ] ], IHasCondition::FIELD__CONDITION => '&' ]) extends Item implements IHasCondition { use THasCondition; use THasValue; protected function getSubjectForExtension(): string { return ''; } }; echo $hasCondition->isConditionMet(7); // true echo $hasCondition->isConditionMet(5); // false