• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.