Welcome Guest, Not a member yet? Register   Sign In
CI4 Validation is_unique in properties Config/Validation
#3

This functionality is what appears to not be working:

https://codeigniter4.github.io/userguide...aceholders

So rather than use a placeholder {post_element} or php variable $var, I had to write the rule in my controller method as follows to get the is_unique rule to work:

DOES NOT WORK:

$rules = [
'perm' => 'trim|required|is_unique[permission.perm,id,$perm_id]'
];

DOES NOT WORK:

$rules = [
'perm' => 'trim|required|is_unique[permission.perm,id,{id}]'
];



WORKS:

$rules = [
'perm' => 'trim|required|is_unique[permission.perm,id,'.$perm_id.']'
];

I'm pretty sure this is a bug. But again, maybe I'm missing something.
Reply


Messages In This Thread
RE: CI4 Validation is_unique in properties Config/Validation - by never2ice - 03-20-2020, 12:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB