generated from yiisoft/package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter data nested forms #68
Open
DAGpro
wants to merge
16
commits into
yiisoft:master
Choose a base branch
from
DAGpro:nested-forms
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e721d2e
Filter data nested forms
DAGpro 4001809
Add tests for populate out nested forms
DAGpro 04301d3
Fix filter nested forms
DAGpro 923b46e
Add doc for displaying nested form fields
DAGpro 9a634a0
Merge branch 'master' into nested-forms
samdark d50a47f
Fix psalm errors
DAGpro 5eca613
Increase code coverage by tests, Fix code style
DAGpro ed59507
Minor fix cs
DAGpro aecde9c
Merge branch 'master' into nested-forms
vjik 1f9b4b1
Fix filtering for protected and private nested forms
DAGpro d6dfa20
Fix minor cs
DAGpro 4aecddf
Generate map for form with nested forms
DAGpro a397a07
Create map for dot-notation keys from Nested rules
DAGpro 424a924
Add dot-notation data to tests
DAGpro 9e37429
Fix minor cs
DAGpro fe1628f
Fix minor cs
DAGpro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
|
||
namespace Yiisoft\FormModel\Tests\Support\Form\PopulateNestedForm; | ||
|
||
|
||
use Yiisoft\FormModel\FormModel; | ||
use Yiisoft\Validator\Rule\Length; | ||
use Yiisoft\Validator\Rule\Nested; | ||
use Yiisoft\Validator\Rule\Required; | ||
use Yiisoft\Validator\Rule\StringValue; | ||
|
||
class FirstNestedForm extends FormModel { | ||
|
||
#[Required] | ||
#[StringValue] | ||
#[Length(min: 3)] | ||
public string $value = ''; | ||
|
||
#[Required] | ||
#[Nested(SecondNestedForm::class)] | ||
public SecondNestedForm $secondForm; | ||
|
||
public function __construct() { | ||
$this->secondForm = new SecondNestedForm(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yiisoft\FormModel\Tests\Support\Form\PopulateNestedForm; | ||
|
||
use Yiisoft\FormModel\FormModel; | ||
use Yiisoft\Validator\Rule\Length; | ||
use Yiisoft\Validator\Rule\Nested; | ||
use Yiisoft\Validator\Rule\Required; | ||
use Yiisoft\Validator\Rule\StringValue; | ||
|
||
|
||
class MainForm extends FormModel { | ||
|
||
#[Nested(FirstNestedForm::class)] | ||
public FirstNestedForm $firstForm; | ||
|
||
#[Required] | ||
#[StringValue] | ||
#[Length(min: 3)] | ||
public string $value = ''; | ||
|
||
public function __construct() { | ||
$this->firstForm = new FirstNestedForm(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
tests/Support/Form/PopulateNestedForm/SecondNestedForm.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
|
||
namespace Yiisoft\FormModel\Tests\Support\Form\PopulateNestedForm; | ||
|
||
use Yiisoft\FormModel\FormModel; | ||
use Yiisoft\Validator\Rule\Integer; | ||
use Yiisoft\Validator\Rule\Length; | ||
use Yiisoft\Validator\Rule\Required; | ||
use Yiisoft\Validator\Rule\StringValue; | ||
|
||
class SecondNestedForm extends FormModel { | ||
|
||
#[Required] | ||
#[Integer] | ||
public int $value = 0; | ||
|
||
#[Required] | ||
#[StringValue] | ||
#[Length(min: 4)] | ||
public string $string = ''; | ||
|
||
public function __construct() {} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that display whole form?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whole?
nested form field or nested form 🤷♂️