Validation Placeholders being ignored for is_unique |
https://codeigniter4.github.io/CodeIgnit...aceholders
PHP Code: protected $validationRules = [ looking at the is_unique method in Rules.php it does not appear {id} is being converted to it's corresponding value in $data. Thanks, Kyle
Something like this?
PHP Code: public function is_unique(string $str = null, string $field, array $data): bool
Any updates on this? This comes in to play when post data needs validating and you call a validation rule set by name... instead of by array... so you can't actually pass {$id}:
$this->validate('user') The is_unique rule does not check for post data... it only looks if the value was passed in the check. Look at my example to see how I worked around this... but I'm not sure if there is a better way? |
Welcome Guest, Not a member yet? Register Sign In |