-
-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Labels
status:ready for adoptionFeel free to implement this issue.Feel free to implement this issue.type:bugBugBug
Description
What steps will reproduce the problem?
public function getRules(): array
{
return [
'submitForVerification' => [
new Required,
new BooleanValue,
],
'tasks' => [
new Each(
new Nested([
'push' => [
new Nested([
'isEnabled' => [
new Required(when: fn() => $this->submitForVerification),
new BooleanValue,
],
'content' => [
new Required(when: [???]),
],
])
],
])
)
],
];
}What is the expected result?
I can set Required validator for content dependent on his sibling isEnabled value.
What do you get instead?
It cannot be done? Or it'll be ugly solution.
Additional info
| Q | A |
|---|---|
| Version | 2.1.x |
| PHP version | 8.2 |
| Telegram message | https://t.me/yii3en/10708 |
vjik
Metadata
Metadata
Assignees
Labels
status:ready for adoptionFeel free to implement this issue.Feel free to implement this issue.type:bugBugBug