forked from codeigniter4/CodeIgniter4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: setValidationRule() cannot use with ruleGroup
- Loading branch information
Showing
5 changed files
with
553 additions
and
5 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of CodeIgniter 4 framework. | ||
* | ||
* (c) CodeIgniter Foundation <[email protected]> | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Tests\Support\Config; | ||
|
||
use Config\Validation as ValidationConfig; | ||
|
||
class Validation extends ValidationConfig | ||
{ | ||
public $signup = [ | ||
'id' => 'permit_empty|is_natural_no_zero', | ||
'name' => [ | ||
'required', | ||
'min_length[3]', | ||
], | ||
'token' => 'permit_empty|in_list[{id}]', | ||
]; | ||
public $signup_errors = [ | ||
'name' => [ | ||
'required' => 'You forgot to name the baby.', | ||
'min_length' => 'Too short, man!', | ||
], | ||
]; | ||
} |
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 | ||
|
||
/** | ||
* This file is part of CodeIgniter 4 framework. | ||
* | ||
* (c) CodeIgniter Foundation <[email protected]> | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Tests\Support\Models; | ||
|
||
use CodeIgniter\Model; | ||
|
||
class ValidModelRuleGroup extends Model | ||
{ | ||
protected $table = 'job'; | ||
protected $returnType = 'object'; | ||
protected $useSoftDeletes = false; | ||
protected $dateFormat = 'int'; | ||
protected $allowedFields = [ | ||
'name', | ||
'description', | ||
]; | ||
protected $validationRules = 'signup'; | ||
} |
Oops, something went wrong.